I'm trying to create a very simple keybinding that lets me do x when the player presses "I". However, all the tutorials I've found are for 1.7.2 or 1.7.10, and they don't work.
I've even tried putting in the key id directly (going by MC's numbering system, where "w" is 17 and "e" is 18), but it's still not working. The event function is printing out the debug message, but it's not recognizing that the key pressed was the key I registered.
That doesn't work, because if you look at the Keyboard class, there is no such thing as KEY_L. Or any other keys. That reference doesn't exist in the parent either. It must have been taken out sometime between 1.7.10 and 1.11.2.
So no, I can't use KEY_L. Believe me, I tried.
I take back all of that. Apparently eclipse imported the wrong Keyboard class....?
EDIT: Changing to Keyboard.KEY_I didn't help. The event still doesn't know that the key pressed was the key I registered.
I'm trying to create a very simple keybinding that lets me do x when the player presses "I". However, all the tutorials I've found are for 1.7.2 or 1.7.10, and they don't work.
I've even tried putting in the key id directly (going by MC's numbering system, where "w" is 17 and "e" is 18), but it's still not working. The event function is printing out the debug message, but it's not recognizing that the key pressed was the key I registered.
Please help.
Here is my code:
https://pastebin.com/aLF5NQw1
Can you not do Keyboard.KEY_L for example?
That doesn't work, because if you look at the Keyboard class, there is no such thing as KEY_L. Or any other keys. That reference doesn't exist in the parent either. It must have been taken out sometime between 1.7.10 and 1.11.2.So no, I can't use KEY_L. Believe me, I tried.I take back all of that. Apparently eclipse imported the wrong Keyboard class....?
EDIT: Changing to Keyboard.KEY_I didn't help. The event still doesn't know that the key pressed was the key I registered.
Hmm...I used the Keyboard class and everything worked perfectly fine.
Could you post your code, please?
It can be found here.