Started by
lol_fantom_lol
on
Topic category: Help with Minecraft modding (Java Edition)
How do I make an aggressive mob, say a zombie, become player neutral when, say, some global variable is true for the player?
Topic category: Help with Minecraft modding (Java Edition)
How do I make an aggressive mob, say a zombie, become player neutral when, say, some global variable is true for the player?
I'm not entirely sure if this is possible- at the very least, not without custom code. Mob aggression is pretty hard coded into different mobs. If you wanted to brute force it, I guess you could add a custom version of the desired mobs that looks and behaves similarly but doesn't attack the player, and then have a procedure that replaces the hostile versions with the passive version when the player is near, using the correct location and rotation to make it (more or less) seamless. This method wouldn't play nice with resource packs though- or other mobs involving said mob.
...If it's specifically in reference to a piece of armor, I know there's a simple way you can use it to de-aggro piglins. But since that's already coded into the game, I don't know if you could do the same for another mob, like Zombies.