Started by
OlekDude
on
Topic category: Help with Minecraft modding (Java Edition)
So I want to make a custom minecraft mob friendly when an I am holding a specific item. Does anybody know how to do that?
Topic category: Help with Minecraft modding (Java Edition)
So I want to make a custom minecraft mob friendly when an I am holding a specific item. Does anybody know how to do that?
Not 100% sure if it works but if you put the block for "follow if holding (item)" or something along those lines and put it at the top of the priority list it might stop it attacking? would need testing since I am not sure just a guess
Okay I tried and in survival mode it doesn't attack if I am holding the item, but if I hold another item and then switch back to it the mob keeps attacking.
I would assume that is just because of how the game works. For example when you swap off wheat and swap back to it, the animals take a moment to register the held item again. Try giving yourself insane health/armor and see if after a while of swapping back to the item it stops attacking
Another thing you could try is making a second version of the mob. When you have the item in your hand despawn it and spawn the friendly version. When you have not got it in your hand despawn the friendly one and spawn the original maybe?
Okay I managed to find out how to do it now.
How did you do it in the end? Just so anyone with the same/similar issue stumbles across this can find out
I gave myself amazing armour and it did eventually turn good again, so I nerfed the mob so it wouldn't be able to kill you as easily when it's switching.