Помогите!!! Как сделать так, что бы при подбирании определённого блока (яйца дракона) выполнилось определённое действие. Плагин.
Вот код:
@EventHandler
public void onPickUpItem(EntityPickupItemEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity() != Material.DRAGON_EGG;
player.sendMessage("NO");
player.playSound(player.getLocation(), Sound.AMBIENT_CAVE,10,2);
}
}
}