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 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The procedure is in the tick…
Fri, 07/24/2020 - 21:59

The procedure is in the tick event of the armor, so I won't unless I have armor on. When set to as the player update tick it will but I  can add a condition on it so it doesn't once I get this working properly.

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you not read the post at…
Fri, 07/24/2020 - 22:01

Did you not read the post at all? "This procedure is in the tick event for all of the armor pieces." I literally said this right near the end.

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It might be causing an issue…
Fri, 07/24/2020 - 22:03

It might be causing an issue but I doubt it. When I remove the procedures from the armor and make on player tick instead, the same issue arises.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I copied your procedure and…
Fri, 07/24/2020 - 23:17

I copied your procedure and ran it in each of my armor ticks and it worked perfectly. Is something else in your mod messing it up?

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know what you guys…
Fri, 07/24/2020 - 23:34

I don't know what you guys are talking about but the fastest way to solve your problem is to take off your procedure from your armor triggers and to only trigger it on player tick. Do what you want but this is the only fastest way, I don't even know how do make this kind of procedure with armor events

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Max094_Reikeb I just tested…
Fri, 07/24/2020 - 23:57

@Max094_Reikeb I just tested the procedure in the armor tick and it worked fine.

In addition, I realize now that keeping the procedure in the armor tick MAY (though not necessarily) be more efficient in some regards than putting it in the player tick, because if it's in the player tick it has to keep checking even when the armor isn't being worn (so running 4x as often when the full set is worn may not run the procedure as often as running it EVERY tick the mod is installed).

I mean no offense in the slightest, but in the future I would recommend not stating that one way is better if you don't know how to do the other way:

"I don't even know how do make this kind of procedure with armor events"

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nothing else in my mod that…
Sat, 07/25/2020 - 01:40

Nothing else in my mod that does anything like this. Nothing that uses any sort of variable called SetEquipped or anything to do with checking for armor. I'll delete and remake the procedure and see if that works and if MCreator was just being dumb for a bit.

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found the issue. I put the…
Sat, 07/25/2020 - 02:04

I found the issue. I put the wrong armor in the tick event and didn't realize it until now. Thank you to everyone who tried to help!

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're welcome, glad you…
Sat, 07/25/2020 - 04:10

You're welcome, glad you found the problem!