MultiInv

359k Downloads

Clearing Inventory using API

ChimpGamer opened this issue ยท 0 comments

commented

Hey,

I'm trying to clear an player inventory on world change like:
@EventHandler public void onWorldChange(PlayerChangedWorldEvent e){ Player p = e.getPlayer(); MIInventory cleaninv = new MIInventory((String) null); if (p != null) { if (p.getWorld().getName().equalsIgnoreCase("creative")) { MultiInv.getPlugin().getAPI().setPlayerInventory(p, "kitpvp", GameMode.SURVIVAL, cleaninv); } } }

But that doesn't seem to work at all. Can someone help me with this?

Kind Regards,
ChimpGamer