diff --git a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/InventoryListener.java b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/InventoryListener.java index ef7e103c2..f9e5275be 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/InventoryListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/InventoryListener.java @@ -76,7 +76,7 @@ public class InventoryListener extends FlagListener { // To differentiate between a Chest and a Trapped Chest we need to get the Block corresponding to the inventory Chest chestInventoryHolder = (Chest) inventoryHolder; try { - if (chestInventoryHolder.getBlock().getType() == Material.TRAPPED_CHEST) { + if (chestInventoryHolder.getType() == Material.TRAPPED_CHEST) { checkIsland(e, player, e.getInventory().getLocation(), Flags.TRAPPED_CHEST); } else { checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);