When you have multiple players on your server, their nametags are always visible through walls, and one has to sneak in order to hide his nametag. It is more realistic to display only nametags of those players which are visible and not hiding behind a wall. This plugin offers exactly that!
Requires PacketEvents API, please put it in your plugins folder aswell!
PLEASE READ THE "Permissions" SECTION BELOW BEFORE ADDING THE PLUGIN TO YOUR SERVER!
Features:
- No invisible armorstands! The plugin is based on vanilla properties (team nametagVisibility for players and customNameVisible for entities)
- Two modes: see nametags of visible players only or see nametag only of the player you're currently looking at
- Option to prevent showing a nametag just by seeing the player's legs and not the head
- Option to treat passable blocks, such as tall grass and cobwebs, as see-through or not
- Works with both players and entities which have a custom name
- Minimal impact on performance*
- Toggleable option for spectators
- Permission for administrators to bypass the plugin and see every player
- Increase players' client FPS by reducing the amount of nametags visible on screen - video showcase below
- Officially tested on Spigot
- Backwards compatible, tested on 1.16.5, 1.19.4, 1.20.4, 1.20.6 and 1.21.5. Let me know if anything breaks on other versions. If using <1.17, make sure to use Java 17!
- Compatible with NEZNAMY'S TAB plugin.
- Compatible with Citizens2 plugin.
- NOT COMPATIBLE WITH DecentHolograms! It works, but the holograms will always be visible through walls. Unfortunately, because of how that plugin spawns invisible armor stands it's very difficult to account for that without changing their code
- Please contact me if any other similar nametag-related plugin interferes with mine and I'll try my best to fix it
*wasn't tested on servers with more than 10 players
Requires Java 17 or newer! (it is the mandatory Java version for servers 1.17 - 1.20.4)
Permissions:
Server operators have all permissions enabled by default, unless explicitly set to false. In case of two contradictory permissions the one listed before is prioritized, so if for example someone has both bypass and blind, they will still see nametags, and blind won't have any effect.
- nametagninja.reload - player can reload the plugin using /nnreload
- nametagninja.bypass - player always sees every nametag regardless of anything
- nametagninja.blind - player never sees any nametag regardless of anything
- nametagninja.opignore - see below
- nametagninja.alwaysvisible - other players will always see this player's nametag
- nametagninja.alwayshidden - other players will never see this player's nametag
The same is with nametagninja.blind - operators would have this true if it is not explicitly set to false, which would result in operators unable to see any nametag.
TL;DR: set default permissions (that are applied to everyone) nametagninja.opignore and nametagninja.blind to false
See the plugin in action:
Configuration:
YAML:
#
# Players with the permission 'nametagninja.bypass' will always see everybody's nametag
# Make sure to run /nnreload (need 'nametagninja.reload' permission) to update the config!
# Remember to increase entity-tracking-range in spigot.yml (the setting tells at which
# distance will players begin to disappear from others)
#
# The plugin only works in these worlds. If empty, it will work in all worlds.
worlds: []
# If true, the player has to look directly at another player to see their nametag.
# For entities, this is vanilla behaviour when custom name visible is set to false.
only-direct-line-of-sight-mode: false
# Whether to include entities in the visibility check.
# Setting both values to false causes the plugin to effectively do nothing.
include-entities: true
include-players: true
# Ignore blocks such as tall grass, cobwebs, etc. when checking lines of sight.
ignore-passable-blocks: false
# Consider only upper body part of players when checking line of sight. If true, seeing only the
# legs of another player is not sufficient to see their nametag, the torso or head must be visible.
# This has no effect on entities other than players.
# This has no effect if only-direct-line-of-sight-mode is set to true.
ignore-player-legs: false
# Always show nametags of others to players in spectator mode.
# If this is false, spectators are treated like every other player; note that when a spectator
# is inside blocks, he technically sees non-spectators, but the plugin will not show nametags.
spectators-xray: true
# Specify a range (how much blocks in each direction). Every entity in that range is checked.
# Setting this to too low will cause noticeable inconsistencies in nametag visibility,
delta-x: 128
delta-y: 90
delta-z: 128