Started by
yeetermod
on
Topic category: Help with Minecraft modding (Java Edition)
So basically i created a full armor set.And if worn it gives some potion effects.So far everything seems to be working.
Now i want to add for example a single lightning strike when equipping the full item set.I tried a lot already and im clueless now, since its looping because of the tick event i guess...
I would appreciate any help :).
Edited by yeetermod on Wed, 02/12/2020 - 14:21
You could make a global bool variable that is primairly set to true, and put the lightning strike in a block if that variable is true. then you make it so after you struck the lightning you set the variable to false. if you want it to play everytime the player equips it, try to find an event when the armor isn't on it will set the variable to true
In your armor update tick procedure, use "Get/Set entity NBT logic tag" from your player entity, or "Get/Set item NBT logic tag" from the armor item. In the armor update tick event, check if the NBT logic tag is false, if so, strike lightning and set the NBT tag to true.
Also, name the tag like "hasBeenWorn" or something like that
Okay thank you guys, managed to get it working ! :D