[1.12.2-R0.1] Hiding a fake player's username using packets

Discussion in 'Spigot Plugin Development' started by GreatThane, Jun 7, 2018.

  1. I'm attempting to make a method for making a player lay face down (I know face up options are readily available, but I wanted to attempt to make a face-down option).
    Right now, I basically have what I want except for one small bug. I cannot figure out a way to hide the fake player I have spawned's username.
    Currently, I'm trying to use the ScoreboardTeam packet (using protocol lib and this packet wrapper) to set username visibility to "never".
    This is my current attempt:
    Code (Java):

    WrapperPlayServerScoreboardTeam createTeam = new WrapperPlayServerScoreboardTeam();
    createTeam.setPlayers(new ArrayList<String>() {{

    WrapperPlayServerScoreboardTeam updateTeam = new WrapperPlayServerScoreboardTeam();
    updateTeam.setPlayers(new ArrayList<String>() {{

    for (Player player : Bukkit.getOnlinePlayers()) {
        if (!(player.getUniqueId().equals(event.getPlayer().getUniqueId()))) {
           // -snip-
            if (gottenCreationPacket.contains(player.getUniqueId())) {
            } else {
    This is the selection of code I feel is related to to problem, but if the entire class is required, I can supply it.
  2. Just put an invisible entity on the fake player's head.
  3. I would like to avoid having a continuous teleportation loop if possible. Is the trick of putting a negatively-sized slime and an entity on that onto the player's head trick still possible?
  4. Why would you need a teleportation loop? You just need to mount any entity on the fake player.
  5. Oh, I didn't actually know that! I'll look into it.