Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Handling in 1.21.2+ #3299

Open
Ste3et opened this issue Nov 5, 2024 · 3 comments
Open

Input Handling in 1.21.2+ #3299

Ste3et opened this issue Nov 5, 2024 · 3 comments

Comments

@Ste3et
Copy link

Ste3et commented Nov 5, 2024

  • [ 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 Screenshot 2024-11-05 164354
1.21.1 Internal Code from ServerboundPlayerInputPacket Screenshot 2024-11-05 164510

@Brokkonaut
Copy link
Contributor

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);

@Lorenzo0111
Copy link

Yep, that works. Is the package still sent multiple times when i keep like W pressed?

@Ste3et
Copy link
Author

Ste3et commented Nov 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants