@EventHandler
public void onClickHead(PlayerInteractEvent e)
{
if(!e.hasBlock()) return;
Player clicker = e.getPlayer();
Location loc = e.getClickedBlock().getLocation();
if(e.getAction() == Action.RIGHT_CLICK_BLOCK)
{
if(e.getClickedBlock().getType() == Material.SKULL)
{
EconomyResponse r = eco.depositPlayer(clicker, 5.00);
if(r.transactionSuccess())
{
e.getClickedBlock().setType(Material.AIR);
clicker.playSound(loc, Sound.ITEM_PICKUP, 1, 1);
clicker.sendMessage(ChatColor.WHITE+"Вы нашли голову и получили"+ChatColor.AQUA+" 5 "+ChatColor.WHITE+"монеток!");
}
}
}
}
}