Solved Unmovable entities

Discussion in 'Spigot Plugin Development' started by RestrictedPower, Mar 22, 2016.

  1. (Please don't spend your time telling me to use a library)
    How is it possible to make a villager entity completely unmovable? I have already tried adding slowness potion effect and it works but still players can push them...
     
  2. you can either

    • make an entity and customize its AI (pathfinding goals, yaw, pitch, behavior, etc. etc.)
    or

    • use mc's vanilla command for removing AI (/summon Villager ~ ~1 ~ {NoAI:1,Rotation:[45.0f,-15.0f]})
     
  3. At your first solution how is that possible?
     
  4. You'll have to extend the NMS mob and remove it's PathfinderGoals. You also have to override the method that handles entity pushing (I don't know it off the top of my head).

    It's also possible to apply the NoAI tag to the entity programmatically so you don't have to run the Vanilla command.
     
  5. Okay I will try that :)