GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.73k stars 680 forks source link

Nametags not being hidden when sending a ScoreboardTeam packet #3088

Closed The-Death-Bringer closed 3 weeks ago

The-Death-Bringer commented 2 years ago

Describe the bug

Using Geyser 2.0.4-SNAPSHOT (git-master-2ea5011) ( Java Edition: 1.19 Bedrock Edition: 1.19.0/1.19.2) Floodgate Paper git-Paper-36 (MC: 1.19) Login mode set to floodgate, online-mode: true When a player joins the server and I send Scoreboard Team Packets to hide the name of an NPC the name is still shown on Bedrock

To Reproduce

1.- Have a plugin trying to hide an NPC (fake player) name 2.- Join the server with bedrock 3.- See the nametag still being shown

Expected behaviour

As stated on the Discord, geyser and bedrock should mimick the Java Scoreboard Team behaviour and hide the Nametag

Screenshots / Videos

No response

Server Version and Plugins

Paper git-Paper-36 (MC: 1.19) TinyProtocol edited to work with 1.19, happens with ProtocolLib 5.0.0-SNAPSHOT-b569 aswell No other plugins are installed

Geyser Dump

No response

Geyser Version

2.0.4-SNAPSHOT (git-master-2ea5011)

Minecraft: Bedrock Edition Device/Version

1.19.2 PC

Additional Context

I also receive this issue when trying to inject the connection for packets, its resolved when the event is changed from PlayerLoginEvent to PlayerJoinEvent, dont happen on 1.18

[13:04:12] [Server thread/ERROR]: Could not pass event PlayerLoginEvent to HighScore v1.0 java.lang.NullPointerException: Cannot read field "b" because "org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.getHandle().b" is null at me.dthbr.hgs.shade.napi.nms.v1_19_R1.NMSBridgeImpl.getChannel(NMSBridgeImpl.java:26) ~[HighScore-1.0.jar:?] at me.dthbr.hgs.shade.napi.utils.NMS.getChannel(NMS.java:17) ~[HighScore-1.0.jar:?] at me.dthbr.hgs.shade.napi.protocol.TinyProtocol.getChannel(TinyProtocol.java:367) ~[HighScore-1.0.jar:?] at me.dthbr.hgs.shade.napi.protocol.TinyProtocol$5.onPlayerLogin(TinyProtocol.java:152) ~[HighScore-1.0.jar:?] at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:37) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:git-Paper-36] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:664) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at net.minecraft.server.players.PlayerList.canPlayerLogin(PlayerList.java:781) ~[paper-1.19.jar:git-Paper-36] at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:182) ~[?:?] at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:93) ~[?:?] at net.minecraft.network.Connection.tick(Connection.java:559) ~[?:?] at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:232) ~[?:?] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1581) ~[paper-1.19.jar:git-Paper-36] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.19.jar:git-Paper-36] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1414) ~[paper-1.19.jar:git-Paper-36] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[paper-1.19.jar:git-Paper-36] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-36] at java.lang.Thread.run(Thread.java:833) ~[?:?]

Camotoy commented 2 years ago

ProtocolLib should be working fine, but I remember that TinyProtocol may not be. Can you attach example code for both instances?

The-Death-Bringer commented 2 years ago

ProtocolLib should be working fine, but I remember that TinyProtocol may not be. Can you attach example code for both instances?

Sorry for the late response and I actually send the packet via NMS I may open another issue with the stacktrace sent by TinyProtocol, sorry for the confusion, but the code I use to send the Team packet is:

https://gist.github.com/The-Death-Bringer/7193bb2a65498d3c6f9f5f1ae9618c1a

Is a complete ClientSide Player NPC, spawned and shown completly with packets

Tim203 commented 3 weeks ago

This issue is quite old, I'm not sure if the issue is caused by the exception you sent. Anyway, in the latest build the scoreboard logic (including nametags) have been reworked. Please open a new issue if the issue persists.