Topic category: User side tutorials
Considering this has been asked plenty of times in the last week I will give a brief explanation on how to do this.
1) Create a global variable (map or world) / logic / starting value false
2) Create a procedure on player tick update: "IF" item in main hand or if get item from slot N° (it depends on what you need) then set global variable to true "ELSE" set global variable to false
3) Go into your mob AI and add the line attack player. Click on condition and apply same conditions for both fields (start and continue): RETURN global variable = true
In this way all mobs will start attacking you once item is equipped / at hand but if you remove item then they will stop attacking you
If you want for him to keep attacking you after the first attack even if item no longer in hand then just remove conditions to "continue" field.
This works for custom models only
Only solution I have for Vanilla mobs is instead adding another procedure: entity joins the world. "IF" entity = (vanilla mob) then despawn entity and spawn your custom mob which is identical to vanilla mob and also same name. At this point repeat points 1 to 3 applied to your mob
Hope this will help someone
When I try to apply the conditions, I don't see any conditions
@Rareshero
click the Conditions button and make a new condition
When I open it all I see is no additional condition
you have to create it. click the + button
What + button ?
https://ibb.co/Gk2S7CH - This is what i see when i click on conditions
yeah make a new element called procedure And make the procedure but make sure to use the conditions so it appears
Can you show me a photo ? I've been searching for 1 hour and I can't think properly...
I know this is an older topic, but I am having issues with this setup. I am trying to make it so that if you are wearing a helmet, leggings, and boots, then the one entity will not attack you, which works fine, but when I take them off, the entity still acts as if I am wearing the armor.
Sorry, I did images wrong, first time using imgur lol
hey lexuigi, i know that was a while ago but today i managed to figure it out
this is my aggressive mob, its meant to not attack when you wear a certain armor set.
the conditions are set to this:
i set up 2 procedures that look like this:
and they just check if the player is wearing the entire armor set and returns either a "false" or "true"
even though i only set one in the conditions both are most likely required, i havent tested removing the second one yet.
anyway, now it works for me.
(you dont wanna know how many hours of searching and testing it took to figure this out)
This is useful, now I can create mobs that target you only if you have bad omen! (to make sure that make sure you don't cause a raid.)
I want to prank my friend and I'm just wondering if there is a way to only aggro a player with a specific NBT tag?
https://mcreator.net/comment/230324#comment-230324 I can't configure this procedure. Please share the file 🙏