ProtocolLib

3M Downloads

GAME_STATE_CHANGE not working

Usepot opened this issue ยท 1 comments

commented

Make sure you're doing the following

  • You're using the latest build for your server version
  • This isn't an issue caused by another plugin
  • You've checked for duplicate issues
  • You didn't use /reload

Describe the question
How do I use Packet GAME_STATE_CHANGE
Ive have tried using packet.getGameStateIDs().write(0,0); and
PacketContainer packet = new PacketContainer(PacketType.Play.Server.GAME_STATE_CHANGE); packet.getBytes().write(0, (byte) 4); packet.getFloat().write(0, 1F);
from #1279 (comment)
and none of them worked, I can send the packet with no added data fine.
Someone pls help me
API method(s) used
List what API method(s) you're using

Expected behavior
A clear and concise description of what you expected to happen.
it supposed to popup demo mode screen but im just trying to get it to pop up the bed missing or bed destructed text rn
Code
packet.getGameStateIDs().write(0,0);
PacketContainer packet = new PacketContainer(PacketType.Play.Server.GAME_STATE_CHANGE); packet.getBytes().write(0, (byte) 4); packet.getFloat().write(0, 1F);
https://pastebin.com/wscHVrV5 error log
Additional context
im trying to make a demo screen popup
idk if this is the write place to report it too :/
im using 1.8.8 paper and some plugins that shouldnt effect protocollib

commented

Thats because in 1.8 the field is an int, not a GameStateId.