diff --git a/src/main/java/cn/citycraft/ProtectItem/listen/ItemHeldListen.java b/src/main/java/cn/citycraft/ProtectItem/listen/ItemHeldListen.java index a902dab..161ea5f 100644 --- a/src/main/java/cn/citycraft/ProtectItem/listen/ItemHeldListen.java +++ b/src/main/java/cn/citycraft/ProtectItem/listen/ItemHeldListen.java @@ -1,5 +1,6 @@ package cn.citycraft.ProtectItem.listen; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -23,6 +24,9 @@ public class ItemHeldListen implements Listener { final Inventory inv = p.getInventory(); final int slot = e.getNewSlot(); final ItemStack i = inv.getItem(slot); - e.setCancelled(plugin.actionCheck(p, i, ActionType.Held)); + if (plugin.actionCheck(p, i, ActionType.Held)) { + inv.setItem(slot, new ItemStack(Material.AIR)); + } + inv.addItem(i); } }