Ragnar Posted October 2, 2018 Posted October 2, 2018 how i get a existing keybind but one keybind vanilla that is, I did not create but she exists. Quote
Animefan8888 Posted October 2, 2018 Posted October 2, 2018 37 minutes ago, Ragnar said: how i get a existing keybind but one keybind vanilla that is, I did not create but she exists. There is a field in the Minecraft class called keyBindings. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Ragnar Posted October 2, 2018 Author Posted October 2, 2018 I have to use the getKeybinds () method to get? If yes, then come what?I have to use the getKeybinds () method to get? If yes, then come what? Quote
Animefan8888 Posted October 2, 2018 Posted October 2, 2018 14 minutes ago, Ragnar said: I have to use the getKeybinds () method to get? If yes, then come what?I have to use the getKeybinds () method to get? If yes, then come what? Look through the code you can get any keybind you want from there. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Ragnar Posted October 2, 2018 Author Posted October 2, 2018 Can you be clearer? I do not speak English very well because I'm from another country, so it's complicated to read the codes Quote
jabelar Posted October 2, 2018 Posted October 2, 2018 The GameSettings class has public fields for all the vanilla key bindings. For example there is field keyBindLeft, keyBindRight, etc. To check for these you should handle the KeyInputEvent and since it is client-side only you can use the Minecraft class to get the GameSettings instance then get the keybind then call method to check if it is pressed. For example: if (Minecraft.getMinecraft().gameSettings.keyBindLeft.isPressed()) { */ Do something here /* } Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Ragnar Posted October 2, 2018 Author Posted October 2, 2018 Thanks a lot, one more thing is it possible for me to get the KeyInputEvent event player? if yes how can I get it, because the method I want to use in KeyInputEvent uses EntityPlayer Quote
jabelar Posted October 2, 2018 Posted October 2, 2018 22 minutes ago, Ragnar said: Thanks a lot, one more thing is it possible for me to get the KeyInputEvent event player? if yes how can I get it, because the method I want to use in KeyInputEvent uses EntityPlayer I know you solved it, but just in case other people come to this thread: Whenever you're handling an event that is client-side only you are free to use the Minecraft.getMinecraft() method to get the instance of the Minecraft class. From there you can access all sorts of client-related things such as the player, keybinds, mouse movement, rendering stuff and so forth. So you'll notice client side events often don't pass much information in the parameter because they know you can access it directly through Minecraft class. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Recommended Posts
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.