FieldAccessException "flags" field of type byte in Play.Server.Abilities cannot be accessed in my plugin?
TheRealWHfan opened this issue ยท 1 comments
Describe the bug
The byte field in play.server.abilities through packetcontainer.getBytes doesn't exist when it should in my custom plugin. I expected it to write the new byte into the packet instead of giving an error as the flags field exists on https://wiki.vg/Protocol#Player_Abilities_.28clientbound.29
To Reproduce
Steps to reproduce the behavior:
- Run a server with protocollib and your own plugin
- Run 3 lines of the following code anywhere in your plugin:
Version Info:
https://pastebin.com/xTF5tZqN
Additional context
The flags field exists when listening to packets being sent to cilent.
The encoding documented on wiki.vg does not always match how the Minecraft internally stores the packet data. In this case, the byte flag is decoded into different booleans. With ProtocolLib, you can only access the fields of the corresponding Packet class, e.g. PacketPlayOutAbilities
/ ClientboundPlayerAbilitiesPacket
in this case. In 1.19.4, it contains the following field: