Problem Hiding Name Tags

Discussion in 'Spigot Plugin Development' started by CrazyTaco, Jul 17, 2018.

  1. Hey! So, I've been looking around for a while now on how to completely hide name tags in spigot 1.8 (not set a players name to " "). From what I understand, you can do this in vanilla Minecraft by making a scoreboard team, and setting name tag visibility on the team to never. When trying to implement this into Spigot, I get no errors, but it doesn't work. I've tried making this work with and without a scoreboard, I haven't been able to get it to work in Spigot period.

    Here's what my code looks like:



    Code (Text):

    public void setScoreboard(Player p ) {

        Scoreboard board = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
        Objective obj = board.registerNewObjective("MCBR", "dummy");
        Team nameless = board.registerNewTeam("nameless");
        nameless.setNameTagVisibility(NameTagVisibility.NEVER);
        nameless.addPlayer(p);
        p.setScoreboard(board);

    }
     
     
  2. bump. Still havent found a fix :/
     
  3. Unfortunately, most of the spigot community here have stopped developing/supporting 1.8 (especially since there are many bugs in the api which will never be fixed). More people will likely be willing to help even if you only moved to 1.9 (better yet, 1.12). You can read up on that more here:
    https://www.spigotmc.org/threads/can-we-officially-cut-off-all-support-for-1-8.328180/
    As such, spigot still is functional for 1.8 and will continue to be for the foreseeable future, but you may find it difficult to get help for it outside of old, pre-existing threads.
     
  4. TheJavaHacker

    Supporter

    You need to make it so that instead of showing the scoreboard, the player JOINS the team.
     
  5. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    He did:
    Code (Text):
    nameless.addPlayer(p);
     
  6. Try switching the setName and setPlayer lines.

    I think it's changing all the names of the current players in the team and then adding the player, which is doesnt change the name until the method is called again

    i dunno, i might be wrong
     
  7. What setname and setplayer lines?
     
  8. It certainly is possible though considering that Hypixel does it in their game Murder Mystery, and it's possible in vanilla.
     
  9. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Murder Mystery was written past 1.8, and if a bug with the Bukkit API existed in 1.8 it's likely they simply used packets to bypass this.
     
  10. From what I understand there is no packet that can bypass it.
     
  11. An interesting fact, the bukkit and spigot apis are pretty much a front for packets. If you wanted to you could make a Minecraft server from the ground up using nothing but packets theoretically.
     
  12. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Have you tried hiding the nametag using vanilla teams?
    If you're able to, then you can definitely use packets.
     
  13. Just look at your own code bruh

    this
    to this:
    Code (Text):


        nameless.addPlayer(p);
        nameless.setNameTagVisibility(NameTagVisibility.NEVER);

     
     
  14. Yes, I was able to hide it in vanilla.
     
  15. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    Then it's probably a Bukkit bug, in which case there isn't anything you can do except update to 1.12. This is why 1.8 doesn't receive official support.

    You could try using packets, but it's somewhat complicated with teams.
     
  16. I think, try to change getNewScoreboard to getMainScoreboard.
    I have not tested yet
     
    #16 Tristiisch74, Jul 18, 2018
    Last edited: Jul 18, 2018
    • Optimistic Optimistic x 1