1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[Mob Stacker] Entity

Discussion in 'Development' started by Hipster, Dec 21, 2016.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    okay, so which entity should i use if i want to stack only the mobs which we can spawn in monster spawners, because if i use "instanceof Living" it also stacks up the players, so which entity instanceof should i use which will stack up mobs and not players and slappers?
     
  2. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    You know you can chain multiple instanceofs right?
    PHP:
    if($entity instanceof Living && !($entity instanceof Player) && !($entity instanceof SlapperEntity)){
       
    //Blah, blah, and blah.
    }
     
    HimbeersaftLP likes this.
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    try
    if the living instance of Player OR Slappable
    halt stacking
     
  4. Hipster

    Hipster Zombie

    Messages:
    214
    How will you change this then?
    PHP:
    public static function stackSize(Living $entity) {
    }
     
  5. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    Remove the type hint.
     
  6. Hipster

    Hipster Zombie

    Messages:
    214
    So this?
    PHP:
    public static function stackSize($entity) {
    }
     
  7. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    You are probably just editing a plugin you found on GitHub...

    Yes, like that.
     
  8. Hipster

    Hipster Zombie

    Messages:
    214
    Not really :p :shoghi:
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.