diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/WorldListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/WorldListener.java index 13be7cf..7d4b6bc 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/WorldListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/WorldListener.java @@ -215,9 +215,16 @@ public class WorldListener implements Listener { return; } - ItemStack itemStack = event.getItemDrop().getItemStack(); + Item item = event.getItemDrop(); + ItemStack itemStack = item.getItemStack(); + String name = itemStack.getType().name(); + if (name.endsWith("_SWORD") || name.endsWith("_AXE") || name.endsWith("_PICKAXE") || name.contains("SHEARS")) { + event.setCancelled(true); + return; + } + game.getDroppedItems().add(itemStack); - game.addEntityToRemove(event.getItemDrop()); + game.addEntityToRemove(item); } @EventHandler