Last active
August 29, 2015 14:03
-
-
Save IDragonfire/d7c800feefcad15deafb to your computer and use it in GitHub Desktop.
Restric Anvil Rename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void inventoryClickEvent(InventoryClickEvent event) { | |
if (!(event.getInventory() instanceof AnvilInventory)) { | |
return; | |
} | |
if (event.getSlotType() != SlotType.RESULT) { | |
return; | |
} | |
if (event.getCurrentItem().getItemMeta().getDisplayName() | |
.contains("Hero Sword")) { | |
event.setCancelled(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment