package com.coldary.events
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
public class SuperPickaxe implements Listener{
@EventHandler
public void rightClickEvent(PlayerInteractEvent e) {
if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
}
}
@EventHandler
public void BreakEvent(BlockBreakEvent e) {
int radius = 5;
int BX = e.getBlock().getLocation().getBlockX();
int BY = e.getBlock().getLocation().getBlockY();
int BZ = e.getBlock().getLocation().getBlockZ();
for(int x = BX-radius; x < BX+radius; x++) {
for(int y = BY-radius; y < BY+radius; y++) {
for(int z = BZ-radius; z < BZ+radius; z++) {
if(e.getPlayer().getWorld().getBlockAt(x,y,z).getType() == Material.STONE) {
e.getPlayer().getWorld().getBlockAt(x,y,z).setType(Material.AIR);
}
}
}
}
}
}```