Skip to content

Feature - Add Nametag Visibility Override - #305

Open
ItsNature wants to merge 1 commit into
version/1.2.9from
feature/nametag-visibility-override
Open

Feature - Add Nametag Visibility Override#305
ItsNature wants to merge 1 commit into
version/1.2.9from
feature/nametag-visibility-override

Conversation

@ItsNature

@ItsNature ItsNature commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Overview

Description:
Adds a per-viewer nametag visibility override to the Nametag module.

Changes:

  • New NametagVisibilityOverride enum:
    • SHOWN: displays the nametag as if the target's team nametag visibility were always (still respecting invisibility).
    • HIDDEN: hides the nametag as if it were never, even when the target is not on any team.
    • NONE: keeps the vanilla behavior.
  • New Nametag builder field: visibilityOverride

Code Example:

 public void overrideNametagExample(Player viewer, Player target) {
     Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

     apolloPlayerOpt.ifPresent(apolloPlayer -> {
         this.nametagModule.overrideNametag(apolloPlayer, target.getUniqueId(), Nametag.builder()
             .lines(Lists.newArrayList(
                 Component.text()
                     .content("[StaffMode]")
                     .decorate(TextDecoration.ITALIC)
                     .color(NamedTextColor.GRAY)
                     .build(),
                 Component.text()
                     .content(target.getName())
                     .color(NamedTextColor.RED)
                     .build()
             ))
+            .visibilityOverride(NametagVisibilityOverride.SHOWN)
             .build()
         );
     });
 }

Review Request Checklist

  • Your code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have tested this change myself. (If applicable)
  • I have made corresponding changes to the documentation. (If applicable)
  • The branch name follows the projects naming conventions. (e.g. feature/add-module & bugfix/fix-issue)

@ItsNature ItsNature added type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition labels Aug 11, 2026
@ItsNature ItsNature mentioned this pull request Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition

Development

Successfully merging this pull request may close these issues.

2 participants