Hey! Could anyone point me in the direction of a good way to find out how to make frozen entities, or a good API. I need them not to be able to move, or be pushed. Thanks!
This kindof goes with @Redrield s signature, but could you show me how I would implement that into a custom entity class?
You shouldn't need to, if they're an implementation of the LivingEntity class, you should be able to call it.
No it doesn't. I'm not sure if LivingEntity#setPushable works, but give it a shot Edit: mb, think they removed it.
@Redrield Is there a simple way to stop them from being pushed? Other than constantly teleporting them of course
I remember a while ago I extended EntityCreeper and wanted to keep his AI but not allow him to move around or be pushed. I believe what I did was override the collision and move methods and left them empty. If you don't want him to have AI at all just ignore the move method and set the AI off as previously mentioned. Code (Text): @Override public void collide(Entity entity) { } @Override public void move(double d0, double d1, double d2) { } EDIT: I'm sure there are other ways to accomplish this as well.
If u are using spigot > 1.8 you can use Villager e = p.getWorld().spawn(p.getLocation(), Villager.class); CraftVillager v = (CraftVillager) e; EntityVillager handle = ((CraftVillager) e).getHandle(); handle.getDataWatcher().watch(15, (byte) 1); // NoAI
The #setCollidable needs to be set from both sides. That means that you need to disable the collision on both the entity and the player. But this brings another problem since arrow and snowball knockback will also disable when you do this. But you can get around it by listening to the playerWorldChangeEvent or look if a player is near an entity.