Zeroing out local variables

Started by Miroslavmcreator on

Topic category: Help with modding (Java Edition)

Last seen on 07:25, 2. Feb 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Zeroing out local variables
Wed, 01/18/2023 - 06:50 (edited)

When the NBT tag "Open" is set to 1, it returns "air, air, air, 0.0, 0.0, 0.0" to chat. The global variables "gift1, gift2, gift3, and giftc1, giftc2, giftc3" are set to non-zero. The trigger for this procedure is "When an item is in inventory.".

...

Edited by Miroslavmcreator on Wed, 01/18/2023 - 06:50
Last seen on 07:25, 2. Feb 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh! It turns out that local…
Sun, 01/15/2023 - 18:04

Oh! It turns out that local variables are reset each time the procedure is restarted. And the NBT tag "item" does not exist. I do not know what to do...

Last seen on 07:21, 7. Feb 2023
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You have no "item" NBT tag…
Sun, 01/15/2023 - 23:59

You have no "item" NBT tag in your procedure, only local variables.. Not too sure what you're trying to do though..

Last seen on 07:25, 2. Feb 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The NBT tag "item" does not…
Mon, 01/16/2023 - 10:31

The NBT tag "item" does not exist in version 2022.1...

Last seen on 07:25, 2. Feb 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm trying to make it so…
Mon, 01/16/2023 - 10:36

I'm trying to make it so that there are two items: wrapping paper and a gift. The wrapping paper has a GUI with three slots and a "pack" button. When you place items and press the "pack" button, the wrapping paper disappears and a wrapped gift with variable or NBT tags appears. And when you right-click with a gift in your hand, the gift disappears and the same items appear.

It turns out that local…
Mon, 01/16/2023 - 18:05

It turns out that local variables are reset each time the procedure is restarted

This is the definition of a local variable.

Check https://mcreator.net/wiki/variables

I also suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Last seen on 07:25, 2. Feb 2023
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I already know what local…
Mon, 01/16/2023 - 19:05

I already know what local variables are. But what I need is that the data is stored in the item itself, but not in the procedure or the World. These are NBT tags. But the problem is that there is no NBT tag "item"! 🍁