- Баллы
- 76
- Имя в Minecraft
- Rfg0
У меня такой код-
Я хочу что-бы из spawnEntity (Зомби) выпадал допустим Алмаз. Как реализовать?
JavaScript:
public void onBlockIgnite(BlockIgniteEvent e){
Material m1 = e.getBlock().getRelative(0, -1, 0).getType();
if (m1 == Material.NETHERRACK){
Material m2 = e.getBlock().getRelative(0, -2, 0).getType();
if (m2 == Material.OBSIDIAN){
Material m3 = e.getBlock().getRelative(0, -3, 0).getType();
if (m3 == Material.OBSIDIAN){
Player p = e.getPlayer();
Block b = e.getBlock();
p.sendMessage("1");
p.sendMessage("2");
p.sendMessage(ChatColor.RED + "Босс вызван!");
Location l = b.getLocation();
World w = l.getWorld();
w.strikeLightning(l);
l.setX(l.getX() +3);
l.setZ(l.getZ() +2);
Zombie spawnEntity = (Zombie) b.getWorld().spawnEntity(l, EntityType.ZOMBIE);
spawnEntity.setMaxHealth(2000);
spawnEntity.setCustomName(ChatColor.RED + "Zombie Boss");
spawnEntity.setCanPickupItems(false);
spawnEntity.setCustomNameVisible(true);
spawnEntity.setHealth(2000);
spawnEntity.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,10000,3,true),true);
spawnEntity.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,10000,3,true),true);
spawnEntity.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,10000,3,true),true);
spawnEntity.setFireTicks(Integer.MIN_VALUE);
spawnEntity.setBaby(false);
spawnEntity.setVillager(false);
Location l2 = b.getLocation();
Location l3 = b.getLocation();
Location l4 = b.getLocation();
Location l5 = b.getLocation();
l3.setY(l3.getY() -1);
l5.setY(l5.getY() -2);
l4.setY(l4.getY() -3);
Block b2 = l2.getBlock();
Block b3 = l3.getBlock();
Block b4 = l4.getBlock();
Block b5 = l5.getBlock();
b2.setType(Material.AIR);
b3.setType(Material.AIR);
b4.setType(Material.AIR);
b5.setType(Material.AIR);