Topic category: Help with Minecraft modding (Java Edition)
I FIXED THE PROBLEM. I accidentally used the wrong armor in the procedure and didn't notice. Oops.
(Mcreator should really show us the item texture when selecting armors instead of the blank white one)
I'm working on a dimension mod and I'm trying to make an armor set that will give you increasing amounts of speed while in the dimension. Here's the procedure set up.
The way it's supposed to work, is it sets a local variable, SetEquipped, to 0 initially. Afterwards, it checks whether or not you're in the right dimension. If you are, then it checks to see what armor pieces you have equipped. The variable goes up 1 for each piece. Once it's done calculating, it will give the player speed with a modifier equal to the SetEquipped variable. However, when I load the game, put on the full set, and enter the dimension, I only get speed 1 despite the fact that I had all the pieces equipped. This procedure is in the tick event for all of the armor pieces.
Does the order mean nothing in MCreator or did I do something wrong?
helmet is 3, body is 2, legs is 1, boots is 0
@ahznb is right. You did the opposite of what you should have done. helmet is not 0, it's 3 and so on
Thank you!
So it actually didn't work. The same thing happens even after switching the values the other way.
try putting this in the player tick global trigger, or put in print statements to check what values the code blocks are actually returning, you know, basic troubleshooting techniques.
Putting it in the player tick procedure didn't do anything. The SetEquipped value is returning 0 (duh). The armor slots are coming back just fine though, so I'm even more confused.
Send a picture of your procedure plz
It's linked on the post. The only thing different at this point is the armor slot values are flipped, so the head is 3, body is 2, legs are 1, and boots are 0.
1. I've heard it's preferred to make the first letter of a local variable lowercase, though I don't know if it actually makes any difference or if it's just for consistency, this may have no relevance.
2. Otherwise, try switching to an nbt variable stored in the player and see if it makes a difference.
3. By the way, potion level 0 is the first level of a potion, so if you aren't wearing any of the armor pieces you will still get the potion effect.
@Xbraxusx if nothing except the numbers is different then how is your procedure triggered? There is no global trigger...
@Xbraxusx and @Max094_Reikeb I just realized you said you called it in all of the armor tick events. The same procedure running over the top of itself so many times may be causing the problem.
Yes but running the procedure on player tick is the only way.....
@Max094_Reikeb No, I mean he said it was running in ALL the armor tick events, meaning it runs once each tick for the helmet, once each tick for the chestplate, etc., when the procedure only needs to be run once each tick, not 1-4 times each tick. If this is the problem, it could be fixed by running it in the global player tick trigger.
OR (possibly) by ONLY adding on to the variable in each armor piece tick, then adding the potion effect in the global player tick.
I think you better use the procedure block set entity vector and set the x player velocity and z player velocity and multiply it by your local variable.