NBT tag not changing

Started by LazerUndefined on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
NBT tag not changing

I did on player tick, for each slot of inventory of Event/target entity get contents copy as itemstack iterator

and set custom data number tag to add a nbt tag when ever the item is in inventory.

I check my item but it didn't add any nbt tags, is it because of its a content copy? if it is, then how do I apply to the real item in inventory?

Joined Jan 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you give an item using …
Mon, 01/12/2026 - 01:19

If you give an item using "Add <count> <item> to <entity> inventory", follow these steps:

  1. Create a local variable of type ItemStack (for example, current_item).
  2. In the procedure, set this variable using "Set item stack <itemStack> to <item>".
  3. Modify the NBT data using "Set custom data <dataType> tag <tagName> of <itemStack> to <dataVariable>".
  4. Finally, give the item using "Add <count> <itemStack> to <entity> inventory".

Something like that: