I want to impliment keyBindSprint for special functionality, but I don't want to modify the source classes. Is there a way I can use keyBindSprint in this case, or maybe something that just says something like,
GameSettings#keyBindSprint is a non-static field and as such must be accessed through an instance of GameSettings. This is stored in the Minecraft#gameSettings field.
KeyBinding#pressed is a private field, so you can't access it from external classes. Use KeyBinding#isKeyDown to check if the key is being pressed continuously (reads the KeyBinding#pressed field) or KeyBinding#isPressed to check if the key has been pressed once (decrements the KeyBinding#pressTime field if it's above 0).
These are both basic Java knowledge.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I want to impliment keyBindSprint for special functionality, but I don't want to modify the source classes. Is there a way I can use keyBindSprint in this case, or maybe something that just says something like,
if CTRL is press
GameSettings#keyBindSprint is a non-static field and as such must be accessed through an instance of GameSettings. This is stored in the Minecraft#gameSettings field.
KeyBinding#pressed is a private field, so you can't access it from external classes. Use KeyBinding#isKeyDown to check if the key is being pressed continuously (reads the KeyBinding#pressed field) or KeyBinding#isPressed to check if the key has been pressed once (decrements the KeyBinding#pressTime field if it's above 0).
These are both basic Java knowledge.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.