How to add a tag to an item in a GUI

Started by RPJOF on

Topic category: Help with modding (Java Edition)

Last seen on 21:01, 9. Apr 2023
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to add a tag to an item in a GUI

Good morning all,

I created a block which, with energy, adds power to an item (which works with an NBT tag of item 0 -> 1000), everything works fine, except that now I should be able to if possible add an NBT tag to the item located in slot # 1 of my GUI.

I don't know if this is possible?

Thank you very much and good day !

Last seen on 20:39, 27. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe use nbt tag block with…
Wed, 05/26/2021 - 19:52

maybe use nbt tag block with entity/player mainhand/itemstack block

Last seen on 21:01, 9. Apr 2023
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I misspoke, infact, the…
Thu, 05/27/2021 - 11:29

I misspoke, infact, the player puts a pickaxe in a slot in the GUI and I would like that when he presses a button in the GUI, an NBT tag is added on the pickaxe.

Last seen on 20:39, 27. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh um maybe if i understand…
Thu, 05/27/2021 - 20:27

oh um

maybe if i understand you right nbt tag edit "entitymainhand/itemstack" in a "if" block checking that its 1 of the pickaxes/custom pickaxes if you have them

if this does not work you could send the workspace and i could try 

Last seen on 21:01, 9. Apr 2023
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No not exactly, 😬, I would…
Thu, 05/27/2021 - 20:54

No not exactly, 😬, I would just need to add an NBT tag to an item that is in a GUI input, if that is possible?