Started by EpicTheJet on Mon, 01/09/2023 - 21:40
Topic category: Help with modding (Java Edition)
I've been trying to make a procedure that checks that a full set of armor is being worn, then on key press it applies potion effects for a few seconds then goes into a cooldown period. Ive gotten it to work but once the armor set is taken off and put back on, it never allows the player to trigger the ability again Any ideas on what I'm doing wrong?
Procedure that im using
Ok so I tried this out myself and at first i got the exact same issue as you. What i think happened was that you took off the armor while it was still on cooldown and so it didnt get the chance to revert the NBT tag back to false. Taking off the armor when it's inactive but not on cooldown and putting it back on again works just fine. Also, if its broken and you switch dimension, it starts working again. However, I currently still don't know what you can do in the procedure to prevent this from happening entirely
Update: ok so i should've found a solution! Instead of using the "wait (x) ticks" and NBT logic tags, i used NBT number tags. You will have to define the same nbt tag on the individual armor pieces' tick update procedures. Make it so that if the number is greater than 0, it will subtract one every tick. Then in the key bind procedure, make the if condition check that all their tags are equal to 0, and make it so after you cast the ability, it sets the number tag to the number of ticks you want the cooldown to be. Idk if that makes sense, I added a picture of the procedure you need to add to every armor piece in their trigger section hopefully that will help