1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Retain item NBT on place.

Discussion in 'Development' started by kriskotooBG, Mar 11, 2020.

  1. kriskotooBG

    kriskotooBG Spider Jockey

    Messages:
    46
    GitHub:
    kriskotoobg
    I am trying to figure out how i can retain some custom NBT strings given to an item (a TnT block), so that way the TnT block has those tags... i was thinking of transferring them on the 'player interact' event, but I'm not sure if there is a better way of doing it.

    Basically what im trying to do is, add a custom TnT block, that does some custom stuff when it explodes...
    (I'm not a noob /i hope XD/, so be free to be as technical as you'd like :slight_smile: )
     
    HimbeersaftLP likes this.
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You would probably need to place a custom tile when the tnt is placed and set the nbt tags to the tile, then when it is ignited it checks for the tile at its position and gets the nbt tags to set to the entity
     
    kriskotooBG likes this.
  3. Provsnoobgaming

    Provsnoobgaming Baby Zombie

    Messages:
    134
    GitHub:
    provsalt
    You can create a tile easily with this virion
    https://github.com/DenielWorld/EzTiles
     
    kriskotooBG likes this.
  4. kriskotooBG

    kriskotooBG Spider Jockey

    Messages:
    46
    GitHub:
    kriskotoobg
    Thanks for the suggestions, using block entities seems like the best solution for this, currently. Thanks!
     
    Last edited: Mar 15, 2020
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.