Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
This commit is contained in:
matt 2019-03-12 16:56:51 -04:00
parent 7b788c07b8
commit cf1764723f

View File

@ -1769,6 +1769,13 @@ import java.util.regex.Pattern;
if (area == null) {
return;
}
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
Material item = event.getItem().getType();
if (item.toString().toLowerCase().endsWith("egg")) {
event.setCancelled(true);
event.setUseItemInHand(Event.Result.DENY);
}
}
ItemStack hand = player.getInventory().getItemInMainHand();
ItemStack offHand = player.getInventory().getItemInOffHand();
Material type = (hand == null) ? Material.AIR : hand.getType();