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

How can i set the nametag height of an entity while creating?

Discussion in 'Development' started by LewBr, Apr 30, 2018.

  1. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Hello, i am creating an NPC with base of Slapper plugin and i need to know how can i change the height of a nametag while creating an entity, the same when player changes the scale and the nametag changes they height, wich DATA should i use?
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    DATA_BOUNDING_BOX_HEIGHT? But it may cause some inconveniences.
     
  3. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    which incoveniences?
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You'll not be able to interact with entities in whatever area the bounding box covers.
     
  5. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
    I think that the desired action can be obtained by arranging FloatingText at the position where the name tag is to be displayed.
     
  6. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    1. Maybe setScale(); ? The size of the entity changes but the nametag stays on the same place.
    2. Set the entity name to whatever you want but add \n
     
  7. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    PS. Edit the code of slapper if you want this method. Slapper hasn't this feature.
     
    Last edited: May 1, 2018
  8. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    No problem, i don't want to interact with the entity, it's just ranking display.
    I don't want to use setScale because changes the entity Scale and \n it's not a good idea too..
     
  9. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Why not \n? About the setScale() I agree but the \n is the only easy solution (and the only idea) for that.
     
  10. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    because i want to keep the text shadow, if i use \n the text doesn't have any shadow and in my opinion, this is ugly.
     
  11. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    I didn't know that, LOL. I raise my hands, idk how to help.
     
  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.