Topic category: Help with Minecraft modding (Java Edition)
so ive searched through all the forms and browsed through everything related to this topic and nothing seemed to have worked or really help me. to put it simply I'm trying to code a mechanic where a mob would not attack a player if they are moving while sneaking/crouching or not moving at all. I'm trying to code it for 1.16.5 and my mcreator version is 2021.2.
event trigger: (no external trigger)
if: [is {event/target entity} sneaking] = false,
do: ( if: [x velocity of {event/target entity} (does not =) 0,
do: return=true),
return=false
this is last attempted code to make this mechanic work, its meant to be a condition for the AI and honestly i cant see what's wrong with it and why it is not working
you could try by setting the mobs attack to 0, and make it target player. then when entity attacks trigger
if event target entity is type: Player
do deal damage # to event target entity
oh sorry, put an AND is event target entity crouching
on the if condition