Skip to content

Instantly share code, notes, and snippets.

@ChimpGamer
Created June 17, 2020 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChimpGamer/44128a5721a4803bdd09970c7a164cfb to your computer and use it in GitHub Desktop.
Save ChimpGamer/44128a5721a4803bdd09970c7a164cfb to your computer and use it in GitHub Desktop.
@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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment