How to add NBT tag for the specific item? (Solved)

Started by ShAdOw112 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to add NBT tag for the specific item? (Solved)
Wed, 04/20/2022 - 19:21 (edited)

I've found a problem: I have an NPC with its unique GUI. Once you press a button NPC gives you an item and then it must give it unique NBT tag (for the concrete item in your inventory). But MCreator doesn't allow to do this! How can I fix it?

Edited by ShAdOw112 on Wed, 04/20/2022 - 19:21
Joined Mar 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've just solved the problem…
Wed, 04/20/2022 - 19:21

I've just solved the problem:

  1. In GUI procedure I set all NBT tags I need to my character into global variables.
  2. I made a procedure with "picking up" trigger. It detects if the picked (provided) item is the one we need.
  3. Then it checks if the player's global variabls aren't equal to "" or 0 (for numerical ones) and if the item doesn't have the NBT tag yet.
  4. The procedure sets NBT item tags to the global variables we set before.
  5. After that it sets the global variables into "" or 0 (for numerical ones). That's it! The concrete item has the NBT tag now!

If you need more explanations I will send screenshots with the solution

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but i want to add NBT tag…
Sat, 01/28/2023 - 12:07

but i want to add NBT tag while my item is added straight to inventory

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so there is no picking it up
Sat, 01/28/2023 - 12:07

so there is no picking it up

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
have the procedure run on…
Wed, 06/07/2023 - 09:01

have the procedure run on the "when item in inventory tick" trigger