Why did this procedure not work? (More speed the more of a specific armor you have)

Started by Xbraxusx on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why did this procedure not work? (More speed the more of a specific armor you have)
Sat, 07/25/2020 - 02:46 (edited)

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?

Edited by Xbraxusx on Sat, 07/25/2020 - 02:46
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
helmet is 3, body is 2, legs…
Thu, 07/23/2020 - 09:30

helmet is 3, body is 2, legs is 1, boots is 0

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@ahznb is right. You did the…
Thu, 07/23/2020 - 10:23

@ahznb is right. You did the opposite of what you should have done. helmet is not 0, it's 3 and so on

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you!
Thu, 07/23/2020 - 19:58

Thank you!

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So it actually didn't work…
Thu, 07/23/2020 - 20:26

So it actually didn't work. The same thing happens even after switching the values the other way.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try putting this in the…
Thu, 07/23/2020 - 21:41

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.

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Putting it in the player…
Fri, 07/24/2020 - 15:39

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.

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Send a picture of your…
Fri, 07/24/2020 - 15:57

Send a picture of your procedure plz

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's linked on the post. The…
Fri, 07/24/2020 - 18:12

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.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1. I've heard it's preferred…
Fri, 07/24/2020 - 18:47

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.

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Xbraxusx if nothing except…
Fri, 07/24/2020 - 19:18

@Xbraxusx if nothing except the numbers is different then how is your procedure triggered? There is no global trigger...

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Xbraxusx and @Max094_Reikeb…
Fri, 07/24/2020 - 19:33

@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.

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes but running the…
Fri, 07/24/2020 - 19:51

Yes but running the procedure on player tick is the only way.....

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Max094_Reikeb No, I mean he…
Fri, 07/24/2020 - 20:05

@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.

Joined Jul 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you better use the…
Fri, 07/24/2020 - 20:32

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.