Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Quirkylee/4418982 to your computer and use it in GitHub Desktop.
Save Quirkylee/4418982 to your computer and use it in GitHub Desktop.
@EventHandler
public void PlayerInteract(BlockDamageEvent event) {
Player player = event.getPlayer();
boolean enabledShovel = plugin.getShovelState(player);
Block block = event.getBlock();
ItemStack itemInHand = event.getItemInHand();
if(enabledShovel == true && itemInHand.getType() == org.bukkit.Material.GOLD_SPADE) {
if(block.getType() == org.bukkit.Material.SNOW || block.getType() == org.bukkit.Material.SNOW_BLOCK) {
event.setInstaBreak(true);
}
event.setCancelled(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment