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

nametag on a chest

Discussion in 'Development' started by Hipster, Oct 20, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    How do i add nametag on a chest like a floatingtext particle? i cant find a function for that..
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You can spawn a FloatingTextParticle just above the nametag.
    PHP:
    /** @var Chest $chest */
    $chest->getLevel()->addParticle(new FloatingTextParticle($chest"Nametag"));
    But you will need to handle spawning/despawning the text on reboots, when the block is broken/replaced etc..
     
  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.