1.8 passenger above nametag (armorstand)

Discussion in 'Spigot Plugin Development' started by IronMan59, Dec 8, 2018.

  1. How do I make a passenger closer to the nametag. What I have right now looks like this. https://i.imgur.com/kJsaZ4O.png
    Code (Text):
     ArmorStand as = e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(new Location(e.getPlayer().getWorld(), 0, 0.1, 0)), ArmorStand.class);
            as.setCustomName(Util.translateMessage("&c&l❤&f " + (int) e.getPlayer().getHealth()));
  2. You could try to use deeper decimals (0.05), that might possibly be a solution. Also, it is not recommended to make custom nametags in that way. If you want something performance-friendly you could try to use the scoreboard packets to modify the nametag.
  3. I would use scoreboard but I was trying to make the health bar above the player nametag.
  4. Spawn a slime with negative size, add the slime to players passengers, add an armorstand as a passenger to the slime.
    Code (Text):
    slime.setSize(-5); //Example
    • Informative Informative x 1
  5. Good idea but I don't think it works because passengers automatically are a certain height so I think I would have to use nms to edit the get passenger thing. I just don't know how to do that
  6. It works I have done it. Setting the slime to a negative height works.

    You can also set different passengers like 2 silverfish and a chicken or something to get the correct height above nametag.
    #6 FalconSeeker, Dec 9, 2018
    Last edited: Dec 9, 2018

Share This Page