Is there a workaround with local variables and the wait function?

Started by eltonsson on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a workaround with local variables and the wait function?

So i've been working in mcreator a while now on a block that duplicates a specific item, but takes ten seconds to do so. And in fact it works the only problem is that you can put any amount of that specific item into it, what i want is that another item can't be put into the "machine" until the last one has come out. By putting the local variable that sees if another one's in the machine, in the wait procedure but that doesn't work and when i put it right under the wait procedure it doesn't work because that prcedure runs at the same time as the wait procedure. Now online i've seen people say "Use global variables instead", well the problem with that is that i can only use one machine at a time.

So if anybody knows how to solve this i would appriciate some help.

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi there, Local variables…
Sun, 02/09/2025 - 10:54

Hi there,

Local variables shouldn't be used in this case, what should be used is the NBT blocks.

You can find these under "block -> actions/data", "entity -> actions/data" and "items -> actions/data". Use whichever one you need for your situation.

I hope this helps.

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you!
Sun, 02/09/2025 - 11:07

Thank you!

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're welcome. I try to do…
Sun, 02/09/2025 - 11:23

You're welcome.

I try to do my best to help people.

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok so i tried it and…
Sun, 02/09/2025 - 12:17

Ok so i tried it and whatever i try errors pop up when i try to start the game is there something i did wrong?