Started by
Bananas
on
Topic category: Help with Minecraft modding (Java Edition)
Hi.
So, this is probably pretty basic knowledge, but I want to make an entity attack you when you are holding a sword. I heard it's possible by "return" procedure blocks, but could someone tell me, how exactly should the procedure look? I mean, I can check if the player is holding sword (the player is event/target entity in this case, right?), but I can't find the right "return" and "true/false" blocks arrangemet. I've tried everything I could think of.
Thanks.
I would suggest your making 2 entities.
One aggressive vs player and one not
Naturally spawn the not aggressive one, when player is holding sword then despawn pacific one and spawn aggressive
Same when player removes sword from hand
I made something similar in my mod and it works fine, I don't see any other possibility in "conditions" since PLAYER is not recognize as event is entity and source no one
Imean I am doing that right now, I just thought there should be a simplier way, as even the attacking AI block has the "coindition" part.
Hi @Bananas i have the same problem and there has to be an easier way. If i get a solution i tell u
I have searched for over 1 year and at the moment i have found no better solution than this
You need to make a new procedure (you can call it what ever) and make a code similar to this:
Event Trigger
IF: Item in main-hand of Event/target entity (you can find this is entity data) = (Whatever you want the item to be)
DO: Return true (blue return is what I used, dont know if its possible with others)
(outside of IF/DO group) Return False
This only works for modded entities. I dont know how to do it for vanilla. I would put an image but I dont know how yet. Hopefully this works
Which is the trigger you use ? Since this won't work with conditions for sure as source entity is not dependency and event is attacking mob