How do I make an NBT tag?

Started by Etecka on

Topic category: Help with modding (Java Edition)

Last seen on 22:34, 9. Jul 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make an NBT tag?

Yes, I have looked this up in the forums, but none of the responses help me actually figure out how to make an NBT tag. Can someone please give me a detailed tutorial?

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It really depends on what…
Wed, 11/22/2023 - 20:48

It really depends on what you need it for. An NBT tag can be anything; once you give an entity a custom NBT tag, it acts like a permanent variable that other procedures can reference. They're such a general tool it's kind of hard to offer a specific explanation.

If, for example, you have a procedure that gives an entity a custom NBT number tag named "awesomeness," you could then have another procedure that changes the value of awesomeness, or procedures that reference this tag to do different things to an entity.

Essentially, you can use the 'set custom NBT (number/logic/text) tag' to apply permanent values to an entity, and can then use the 'get NBT tag' to get that same value, if it exists; you just have to make sure to use the same name.