#Hide Gamertags of Certain Players

9 messages · Page 1 of 1 (latest)

wheat torrent
#

hello, I was wondering if it was possible to hide the gamertag for certain players only, and not for everyone?

I already know that you can remove the gamertag for everyone by editing minecraft:nameable in the player's JSON file, but I want to be able to manually toggle gamertags for a certain player.

One idea I had was to somehow change the component of the JSON file using an event or something, but I couldn't find anything about doing so. Is it even possible, or do I just have to stick with hiding everyone's gamertag?

wheat torrent
#

Hide Gamertags of Certain Players

jovial breach
#

Your idea is pretty close to how this would be executed. Events can change components by applying something called a "component group".

#

In this component group you can put the "minecraft:nameable" component, then use events to either add or remove that component group. Here is an excerpt of what that might look like:

{
  "component_groups": {
    "has_name": {
      "minecraft:nameable": {
        "always_show": true
      }
    }
  },
  "events": {
    "show_name": {
      "add": {
        "component_groups": [
          "has_name"
        ]
      }
    },
    "hide_name": {
      "remove": {
        "component_groups": [
          "has_name"
        ]
      }
    }
  }
}
#

In-game you can use the /event command on a player using either that "hide_name" or "show_name" event to toggle on and off the name tag visibility.

wheat torrent
#

ooh, interesting. would creating a second component_group with the always_show tag set to false work alongside the first one?

#

or does it only modify that one component

jovial breach
#

You could use another component group with that set. Players' name tags would still be visible if their hitbox is hovered over, so if that is what you want then you can choose to use another component group instead

wheat torrent
#

yeah I just need the players' name tag to not be visible all the time, that could work. I'll try that out