Skip to content

Commit 8b170d6

Browse files
authored
Fix: Nametags are not shown in some other cases (#4447)
1 parent e97258f commit 8b170d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/main/java/org/geysermc/geyser/entity/type/player/PlayerEntity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ protected void initializeMetadata() {
120120
super.initializeMetadata();
121121
// For the OptionalPack, set all bits as invisible by default as this matches Java Edition behavior
122122
dirtyMetadata.put(EntityDataTypes.MARK_VARIANT, 0xff);
123-
// Since 1.20.60, the nametag does not show properly if this is not set :/
124-
// The nametag does disappear properly when the player is invisible though.
125-
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
126123
}
127124

128125
@Override
@@ -154,6 +151,10 @@ public void spawnEntity() {
154151
addPlayerPacket.setGameType(GameType.SURVIVAL); //TODO
155152
addPlayerPacket.setAbilityLayers(BASE_ABILITY_LAYER); // Recommended to be added since 1.19.10, but only needed here for permissions viewing
156153
addPlayerPacket.getMetadata().putFlags(flags);
154+
155+
// Since 1.20.60, the nametag does not show properly if this is not set :/
156+
// The nametag does disappear properly when the player is invisible though.
157+
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
157158
dirtyMetadata.apply(addPlayerPacket.getMetadata());
158159

159160
setFlagsDirty(false);
@@ -377,7 +378,6 @@ public void updateDisplayName(@Nullable Team team) {
377378

378379
if (needsUpdate) {
379380
dirtyMetadata.put(EntityDataTypes.NAME, this.nametag);
380-
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
381381
}
382382
}
383383

0 commit comments

Comments
 (0)