Disable movement of mobs?

Discussion in 'Plugin Development' started by ThunderWaffeMC, Jun 26, 2013.

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

    ThunderWaffeMC

    Is there a way to stop movement of all mobs in all worlds? I want to place mobs so they don't move from the block they're standing on but they can still attack players.

    I don't want to go to the complexity of "if a mob stands off the block then teleport them back to the one they were on". Is there any way to do this?

    Thanks!
     
  2. Offline

    Morrango

    This would involve using craftbukkit. I don't think this is possible with bukkit API yet.
     
  3. Offline

    Rocoty

    Try repeatedly setting their velocity to 0, 0, 0

    Be warned that this might be heavy on processor if the mob count is high
     
  4. Or you create a custom mob without certain GoalFinders
     
  5. Offline

    ThunderWaffeMC

    Rocoty Sgt_Tailor I think I will try both of them. The thing I want to do is when you type "/buy building archer" it places a skeleton with fences around it (can't move anyway). But I want to make another one so there's a wither skeleton (boss) on top of a small mountain. The mob will just fly away wont it?
     
  6. Offline

    foodyling

    This isn't a *good* way of doing this, but you could just apply the SLOWNESS effect to a mob once they reach a certain block.
     
  7. Offline

    ThunderWaffeMC

    foodyling This want stop the movement though and that's really what I want (unless the slowness means it takes them a very long time to get off the block they're standing on.
     
  8. Offline

    foodyling

    Just apply level 30 Slowness for Integer.MAX_VALUE
    target.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, Integer.MAX_VALUE, 30)); Technically, they might slowly move off, but it'd take a REALLY long time
     
  9. Offline

    ThunderWaffeMC

    foodyling Thanks. How long do you think they'll take to move from 1 block to another? And is it just the walking speed so they can still move quickly?

    foodyling What does "target" represent as in "target.addPotionEffect"?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  10. Offline

    chasechocolate

    ThunderWaffeMC the player or LivingEntity who you want to add the PotionEffect to.
     
  11. Offline

    foodyling

    The entity you want to add it too, also, I'm pretty sure you're not going to have a zombie standing there for hours.
     
  12. Offline

    AstramG

  13. Offline

    ThunderWaffeMC

    Thanks everyone.
     
  14. Offline

    TheTinySpider

    ThunderWaffeMC
    Slowness LVL 6 is enough in 1.5.2 to completly stop an entity from moving, apply that with the Integer.MAX_VALUE and you get yourself an frozen mob :)

    EDIT:
    Entitys could potentialy move when jumping, apply Jump Boost -6 to also stop them from junping :)
     
    ThunderWaffeMC likes this.
Thread Status:
Not open for further replies.

Share This Page