July 11, 20232 yr short ago i learn this way to get the main keys in the server side only if (!player.getLevel().isClientSide()) { Minecraft instance = Minecraft.getInstance(); KeyMapping keyUse = instance.options.keyUse; KeyMapping keyAta = instance.options.keyAttack; KeyMapping keyMid = instance.options.keyPickItem; //Player pe = instance.player; if( keyUse.isDown() ) { System.out.println("tick( Right use " + keyUse.getKey().getValue() + ");"); } if( keyAta.isDown() ) { System.out.println("tick( Left atack " + keyAta.getKey().getValue() + ");"); } if( keyMid.isDown() ) { System.out.println("tick( Middle pick " + keyMid.getKey().getValue() + ");"); } } if is custome keybinds you have to search youtube for kaupenjoe courses about keybinds and networking
July 17, 20232 yr It is. The code provided will crash on dedicated servers, and only check the host keybindings in a LAN world. It should not be used.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.