Solved Calling and giving items to a zombie

Discussion in 'Plugin Development' started by piddi24, Dec 30, 2020.

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

    piddi24

    This is my code:

    Code:
    package me.hardboom.ultimate;
    import org.bukkit.*;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.*;
    public class Mobs {
        public void zombie(){
            Entity getentity = Bukkit.getEntity(null);
            if(getentity.equals(Entity.ZOMBIE)) {
               
            }
       
        }
    }
    
    I want it to be so if the getentity equeals a zombie, it gives the zombie armor..
    How can I do that(Entity.ZOMBIE does not work in the if statement)
     
  2. Offline

    xelatercero

    Do you have any Java knowledge? I mean this is totally wrong:

    and the if statement as well , and your imports too...
     
  3. Offline

    piddi24

    I am very new to java
     
  4. Offline

    xpaintall

    You will need to use the CreatureSpawnEvent for this.
    So do:

    Code:
    if (event.getEntityType() == EntityType.Zombie) {     
           Zombie zombie = (Zombie) event.getEntity();
    
           zombie.getEquipment().set (or add i am typing on my phone)
           
           
    
    } 
    i hope this helps as an example
     
  5. Offline

    Kars

    PHP:
    if (event.getEntity() instanceof Zombie)
    or
    PHP:
    if (event.getEntity().getType() == EntityType.ZOMBIE)
    and then
    PHP:
    EntityEquipment zombieEquipment event.getEntity().getEquipment();
    with
    etc..
     
Thread Status:
Not open for further replies.

Share This Page