What's the default value of a custom nbt tag?

Started by Kleiders on

Topic category: Help with MCreator software

Active 7 months ago
Joined Dec 2016
Points:
945

User statistics:

  • Modifications: 2
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 3
  • Comments: 123
What's the default value of a custom nbt tag?

I created an nbt tag called "no_modifier" and I am using to creati a modifier system. The problem is that for it to work, I want to put as a condition that the item has to be in it's default state. How do I know an item's default nbt tag?

Active 7 months ago
Joined Dec 2016
Points:
945

User statistics:

  • Modifications: 2
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 3
  • Comments: 123
I tried with 0, but it wasn…
Sun, 06/21/2020 - 05:55

I tried with 0, but it wasn't it :/ I ended up using name display for the first modifier, even though is less efective and more time consuming.

Active 2 years ago
Joined Mar 2020
Points:
905

User statistics:

  • Modifications: 3
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 367
not 0?!
Sun, 06/21/2020 - 08:16

not 0?!

Active 9 months ago
Joined Jun 2019
Points:
2792

User statistics:

  • Modifications: 4
  • Forum topics: 48
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3704
you could use a nbt logic…
Sun, 06/21/2020 - 10:01

you could use a nbt logic tag instead which is a true/false value and defaults to false

Active 7 months ago
Joined Dec 2016
Points:
945

User statistics:

  • Modifications: 2
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 3
  • Comments: 123
I need the value to be able…
Tue, 06/23/2020 - 04:29

I need the value to be able to be changed to a different text value, so using a true/false value wouldn't work :c thanks anyway for trying to help! I will continue using the name display for the first modifier, since it works.

Active 2 years ago
Joined Mar 2020
Points:
905

User statistics:

  • Modifications: 3
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 367
boolean nbt isnt_fresh(will…
Tue, 02/09/2021 - 07:45

boolean nbt isnt_fresh(will default to false)

on item in inventory tick:

>>if is item fresh(nbt isnt_fresh is false):

>>>>make item not fresh(set isnt_fresh nbt to true)

>>>>set no_modifier to some default value ya prefer