Solved Pushable mobs

Discussion in 'Plugin Development' started by CheesyFreezy, Jun 6, 2016.

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

    CheesyFreezy

    Hey Developers,

    I am back with another problem. I am making a NPC in Minecraft 1.9. I set the Data Tag 'NoAI' to 1, so the mob is frozen, but I can still push the mob. How can I make that the mob will be frozen and cannot be pushed away by anything?

    I hope someone knows how to do this!
     
  2. Offline

    XxTimexX

    Never worked with mobs. But one way should be getting their position before pushing, and after they were pushed getting them back on their position. Ofc, not sure would this work, since I never worked with mobs.
     
  3. Offline

    Xerox262

    @CheesyFreezy Are you using bukkit or spigot? If I remember correctly spigot has a variable for each CraftEntity called collideWithEntities, setting this to false should stop pushing.
     
  4. Offline

    Zombie_Striker

  5. Offline

    Xerox262

    @Zombie_Striker When did they add that? Also I assume that when it says "collidee and the collidant to ensure no collisions take place" it means mobs will still get pushed back trying to collide with it but it won't itself, correct?
     
  6. Offline

    Zombie_Striker

    @Xerox262
    That means the other entities that can collide will be pushed, but not the main entity. This means a random mob like a cow will be pushed back, but not the NPC.
     
    Xerox262 likes this.
  7. Offline

    CheesyFreezy

    Thank you this worked!
     
    Last edited: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page