Input Handling in 1.21.2+
Ste3et opened this issue ยท 3 comments
- [ x] This feature is not currently present in a development build
Is your feature request related to a problem? Please describe.
The PacketType.Play.Client.STEER_VEHICLE
works internal with net.minecraft.world.entity.player.Input
and the set/get methode inside PacketContainer is mising and there isn't a data type present.
Describe the solution you'd like
Please add an function to get the Player Input and work with an Wrapped Object
Error Log from 1.21.3
Error Log
1.21.3 Internal Code from ServerboundPlayerInputPacket
1.21.1 Internal Code from ServerboundPlayerInputPacket
Try something like this:
PacketContainer packet = event.getPacket(); InternalStructure input = packet.getStructures().read(0); boolean forward = input.getBooleans().read(0); boolean backward = input.getBooleans().read(1); boolean left = input.getBooleans().read(2); boolean right = input.getBooleans().read(3); boolean space = input.getBooleans().read(4); boolean shift = input.getBooleans().read(5);
Thank you @Brokkonaut i forget about it, atm i have so much trouble with my shool that i make simultaneously as my fulltime job
Try something like this:
PacketContainer packet = event.getPacket();
InternalStructure input = packet.getStructures().read(0);
boolean forward = input.getBooleans().read(0);
boolean backward = input.getBooleans().read(1);
boolean left = input.getBooleans().read(2);
boolean right = input.getBooleans().read(3);
boolean space = input.getBooleans().read(4);
boolean shift = input.getBooleans().read(5);