Minecraft/Spigot: Porting from Spigot 1.8 to 1.20 | Packets

192 Views Asked by At

Hello I wanted to port a old plugin from 1.8 to 1.20.

I never used a higher version than 1.8 spigot and I also didnt coded anything since 4 years in that either. My old Plugin contained a function which sends a packet to the player to show the credits.

PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(4, 1);
((CraftPlayer) t).getHandle().playerConnection.sendPacket(packet);

And as I am apparently to stupid to google it properly, can someone explain how this works nowadays. My english is also not very good as it isnt my mother tongue, so pls explain it like you would do to a 5 year old. Thanks in advance.

Googled it and most people said to just use ProtocolLib but yeah I could do that but then I still dont know how it is doing it and I want to understand it.

1

There are 1 best solutions below

1
user23010873 On

I got it working sorry for making a stupid question didnt know I need to add the api and also the normal spigot.jar to the project dependencies