- Баллы
- 103
- Имя в Minecraft
- Killing
Всем привет!
Вот написал такой код(Полный не дам
):
Код:
private Random r; - Переменная в самом начале
@EventHandler
public void onEntityDeath(EntityDeathEvent e)
{
if(e.getEntity().getCustomName() != null)
{
if(e.getEntity().getCustomName() == "Злой зомби")
{
e.getDrops().clear();
byte m = (byte) r.nextInt(3);
ItemStack gApple = new ItemStack(Material.GOLDEN_APPLE);
ItemStack steak = new ItemStack(Material.COOKED_BEEF);
ItemStack lChest = new ItemStack(Material.LEATHER_CHESTPLATE);
if(m == 0)
{
e.getDrops().add(gApple);
}
if(m == 1)
{
e.getDrops().add(steak);
}
if(m == 2)
{
e.getDrops().add(lChest);
}
}
}
if(e.getEntity().getCustomName() != null)
{
if(e.getEntity().getCustomName() == "Злая ведьма")
{
e.getDrops().clear();
ItemStack potion = new ItemStack(Material.POTION);
e.getDrops().add(potion);
}
}
}
P.S. Всем помощникам - лайк

Последнее редактирование: