ProtocolLib

3M Downloads

1.20.2 SCOREBOARD_DISPLAY_OBJECTIVE bug

LeeTheTech opened this issue ยท 1 comments

commented

Describe the bug
The packet SCOREBOARD_DISPLAY_OBJECTIVE no longer has a integer to change the position of the scoreboard.

To Reproduce
Steps to reproduce the behavior:

PacketContainer packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);
packet.getIntegers().write(0, 2);

5c98b9a4c54eb10f173d75fc4308b1c9

Error:

com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:245) ~[ProtocolLib.jar:?]

This worked fine on 1.20.1 but not 1.20.2.

Expected behavior
To show hearts below the player's name.

Version Info
https://pastebin.com/jQg4wctb

Additional context
I didn't have any other issues on 1.20.2 using the scoreboard packets. I'm unsure if this a ProtocolLib issue or if Mojang just changed how this is set now.

commented

nvm, you can do this now by doing:
packet.getEnumModifier(DisplaySlot.class, 0).write(0, DisplaySlot.BELOW_NAME);