This ticket issue has been originally made on PocketMine-MP repo. It seems that PocketMine didn't changed anything about it and is doing the things right on protocol side.
I don't have the skills needed to reproduce this behavior with a vanilla content (I guess it's possible through mcaddons ?) since it's only something that can be done with custom software servers.
Issue description
Expected result: The player username should be hidden
Actual result: When some conditions are met the username is visible through blocks
Steps to reproduce the issue
Two players connects
One player (player A) triggers something which will calls the code below on himself
The other player (player B) will still be able to see its username.
It does work if the player B disconnects and reconnects (the player B needs to login after the player A one).
Pocketmine code to reproduce :
$sender->setNameTagAlwaysVisible(false);
$sender->setNameTagVisible(false);
Initially tested on :
PocketMine-MP: 5.21.1
PHP: 8.2.17
Using JIT: no
Server OS: Debian 11
Game version: All (tested on android + windows in both ways)
Plugins
If you remove all plugins, does the issue still occur?
Tried with just the example plugin and yes.
- Here's a minimal reproducing code for the issue (just added the previous sent code) based on pmmp/Exampleplugin repository
[Exampleplugin.zip](https://github.com/user-attachments/files/17925508/Exampleplugin.zip)
Video files
Here's two recording of me reproducing the bug. The Windows one is the player A and the android one is player B, both videos are almost in sync.
Windows:
https://github.com/user-attachments/assets/fe7fb658-93cb-44e9-8b4e-af826c1d5a2a
Android:
https://github.com/user-attachments/assets/c63b6106-15d6-45f2-a5b3-1e550729f0ce
Protocol details
The concerned protocol is "always show nametag" tag (id 81) of MetadataDictionary which is used in packet set entity data (id 39), packet add player (id 12) and packet add entity (id 13).
Pocketmine setNameTagVisible function seems to use the "CustomNameVisible" NBT TAG_Byte on the entity
It looks similar to an old ticket MCPE-28244