How can I make my custom blocks "have" NBT data, such as damage values, or full blown custom NBT tags? My specific case is adding a "luck" component to my custom block, which can be anywhere between -100 and 100, and depending on that value, when placed and broken in the world, would do something different, for example, if the value is positive, it would drop a diamond, when it's negative it would summon primed tnt, and if it's zero it would create a dirt hut. I think I can work those out, but I first need my block to be able to store data.

Thank you for your time.

  • 5
    Does this answer your question? Is it possible to use NBT tags in commands in Minecraft Bedrock Edition?
    – Corsaka
    Commented Mar 29, 2021 at 8:37
  • 2
    @Corsaka Are you sure? Accessing NBT tags in commands is much different than accessing them through other means. The proposed duplicate only takes account if the user is using commands, which they are open to other methods too.
    – One 2 Many
    Commented Mar 30, 2021 at 4:14
  • 1
    @Corsaka this is about addons not datapacks or commands
    – Penguin
    Commented Mar 30, 2021 at 19:12
  • 1
    @Corsaka For your information Java Edition datapacks are not off-topic.
    – One 2 Many
    Commented Mar 31, 2021 at 2:45
  • 1
    @Corsaka Unfortunately, the post you linked to doesn't quite solve my problems - I'm looking to create an addon that has a custom block that can hold a "luck" variable, an integer from -100 to +100, both in the world and as an item in an inventory, and when the block is broken, should take into account the value regarding what happens afterwards. Commented Mar 31, 2021 at 5:58


You must log in to answer this question.

Browse other questions tagged .