Holographic Name : Using ArmorStand on MoveEvent + Removing regular username.

Discussion in 'Spigot Plugin Development' started by fujiboy4, Jun 20, 2015.

  1. Hey guys. (and gals) Wondering if you could help me a bit with my code. I want this plugin to remove the players default username above their head and set an armor stand in its place (like a hologram) with their name on it. Must be invisible.

    Code (Text):
    @EventHandler
    public void move(PlayerMoveEvent e) {
    final Player p = e.getPlayer();
    final World w = p.getWorld();
    final Location loc = p.getLoaction().getEyeLocation();

                ArmorStand a = (ArmorStand) p.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
                a.setCustomName(ChatColor.YELLOW + p.getName());
                a.setCustomNameVisible(true);
                a.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999, 90));

    p.getCustomNameVisible(false);

    }
    I'm not sure if this is how you would do it, but I'm hoping I'm correct.
     
  2. sothatsit

    Patron

    I'm not sure if you can remove their name tag above their head?
     
  3. Hmm.. I've seen mineplex's ... They somehow get rid of the default username..
     
  4. sothatsit

    Patron

    You can rename the player using packets and you can add prefixes/suffixes to their names using scoreboards.

    What are you looking to do?

    Something like "[Admin] sothatsit"?
     
  5. I see what you are typing to get at. But, I want the default username above the players head to be completely invisible.
     
  6. Try make the armour stand ride the player might give a better effect.
     
  7. Use NMS to put an entity on there head then just do entity.isVisible or entity.setInvisible not sure which one it is but those work. Then if you want to make it a custom name just set the entities custom name to something then entity.setCustomNameVisible("true");
     
  8. I dont think its possible to remove the players nametag, however there are some methods in spigot if you wish to altar the ones already there,

    maybe: player.setPlayerListName("Something");