Skip to content

Instantly share code, notes, and snippets.

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
fun onInventoryPickupItem(event: InventoryPickupItemEvent) {
val displayName = event.item.itemStack.itemMeta.displayName
if (chestShopAddon.dataHandler.chestShops.values.any { it.item == event.item } ||
displayName == "ChestShopIcon") {
event.isCancelled = true
}
}