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

How to use Block setMetadata?

Discussion in 'Development' started by Victorio, Feb 2, 2021.

  1. Victorio

    Victorio Creeper

    Messages:
    3
    GitHub:
    utaldovic
    I need help with setMetadata.

    What I put in MetadataValue?

    My code:

    $blk = $ev->getBlock();
    $blk->setMetadata('custom_tnt', ????);

    Please I need help
     
  2. mmm545

    mmm545 Baby Zombie

    Messages:
    152
    GitHub:
    mmm545
    What are you trying to do
     
  3. Victorio

    Victorio Creeper

    Messages:
    3
    GitHub:
    utaldovic
    A Customized TNT, when placing it on the floor it needs to differentiate itself from the normal TNT.
     
  4. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    As far as I know, PMMP, or Bedrock Edition doesn't support block NBT(please correct me if I'm wrong).
    However, you can set NBT to the item and have a check for the nbt on place.

    Alternatively, you can also use tiles!
     
    Primus likes this.
  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.