Started by
TheReallyFatChicken
on
Topic category: Help with Minecraft modding (Java Edition)
So, I was wondering if there's a way to create a block-locked entity that cannot be pushed around. I can easily make it so it doesn't move on its own, but the player can still shove it, which is bad (It's pretty much a demon plant/flower that's supposed to be "rooted down").
Edit: You can have an On Entity Tick Update with Run Command data merge entity @s {NoAI:1}, which makes it immovable but also unable to move at all.
Edited by TheReallyFatChicken on Thu, 07/16/2020 - 17:42
If you know how to code, override;
and set it false.
I could easily find that, but do I just do EntityLiving::canBePushed:false or something like that? I'm not the best at coding.
There are two methods that you can use to achieve this;
The method LivingEntity::canBePushed returns true if you want the entity to push and be pushed by other entities.
The method LivingEntity::canBeCollidedWith returns true if you want the entity to not be able to go through the entity.
You can use both, it is up to you. Return false if you don't want the above descriptions to happen.
The first one doesn't seem to be working for me.