Custom Mob Dont Spawn

Discussion in 'Plugin Development' started by Profan, Jun 7, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Profan

    i tried to make when a skeleton spawn it will spawn with a lot of things, but when they spawn nothing happens, and it dont have any errors, here is my code:
    Code:java
    1. @EventHandler
    2. public void BlayshanTheNigga(CreatureSpawnEvent e)
    3. {
    4. if ((e.getEntity() instanceof Skeleton))
    5. {
    6. final Skeleton s = (Skeleton)e.getEntity();
    7. {
    8. int vida = 8000 + (int)(Math.random() * 26000.0D);
    9. s.getEquipment().setItemInHand(new ItemStack(Material.DIAMOND_AXE));
    10. s.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
    11. s.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    12. s.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
    13. s.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
    14. s.getEquipment().setItemInHandDropChance(0.0F);
    15. s.getEquipment().setHelmetDropChance(0.0F);
    16. s.getEquipment().setChestplateDropChance(0.0F);
    17. s.getEquipment().setLeggingsDropChance(0.0F);
    18. s.getEquipment().setBootsDropChance(0.0F);
    19. s.setCanPickupItems(false);
    20. s.setCustomName(ChatColor.YELLOW + "Blayshan The Nigga");
    21. s.setRemoveWhenFarAway(true);
    22. s.setCustomNameVisible(true);
    23. s.setMaxHealth(vida);
    24. s.setHealth(vida);
    25. s.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,
    26. 2147483647, 0));
    27.  
    28. }
    29. }
    30. }
     
  2. Offline

    xTigerRebornx

    Profan Try getting rid of the initializer block that it is in
     
  3. Offline

    Profan

    what?
     
  4. Offline

    GreatMinerZ

    Profan
    Code:java
    1. int vida = 8000 + (int)(Math.random() * 26000.0D);
    this.
     
Thread Status:
Not open for further replies.

Share This Page