Make Entity Unpushable

Discussion in 'Plugin Development' started by ZonalYewHD, Jan 19, 2015.

Thread Status:
Not open for further replies.
  1. I am working on a custom entities plugin, and would like to make it to where mobs cannot be pushed by players. I've already achieved freezing them, but I don't know how to make them unpushable. I've been able to find the bounding box, but I don't know how I could create a custom mob and overwrite the current mobs with instances of mine. How would I do so?
     
  2. Offline

    Avery246813579

    @ZonalYewHD Create a custom mob takes a lot of unneeded time Just give the mob a new slowness potion, I suggest something like this:
    Code:
    addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 10000000, 300));
    After you have slowed the entity, create a new runnable that runs every second (20 ticks) and inside that runnable teleport the entity to the starting location.

    You will probably need to store these unmovable mobs in a List so you can loop through them easily.
     
Thread Status:
Not open for further replies.

Share This Page