Jump to content

Thigh Exercise

Members
  • Posts

    2
  • Joined

  • Last visited

Thigh Exercise's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. update: So I tried to get the keys like so: public static InputMappings.Input[] allVanillaKeys = new InputMappings.Input[22]; allVanillaKeys[0] = Minecraft.getInstance().gameSettings.keyBindAttack.getKey(); allVanillaKeys[1] = Minecraft.getInstance().gameSettings.keyBindForward.getKey(); I then flipped the keys with each other Minecraft.getInstance().gameSettings.keyBindAttack.bind(allVanillaKeys[1]); Minecraft.getInstance().gameSettings.keyBindForward.bind(allVanillaKeys[0]); But when I tried running it in game, the game couldn't save options and the game crashed due to a NullPointerException, so I guess switching the keys like that nullifys some stuff.
  2. I'm trying to make a mod that involves randomly rebinding vanilla controls without user input however I'm confused on the InputMappings.Input class . I'm trying to use an instance of KeyBindingMap like so: public static KeyBindingMap allBinds; to change the mapping of vanilla controls. I get the vanilla binds like so: Minecraft.getInstance().gameSettings.keyBindAttack I then try to change the keybindings like so: allBinds.addKey( ??? ,Minecraft.getInstance().gameSettings.keyBindAttack); the first variable needs to be an instance of InputMappings.Input, but I'm very confused on how to use it. I'm not trying to record user input for this. I want to randomly switch around keyCodes from a predefined set of keys so that one event is done through a different key after the switch. I've already tried removing all the keys in the map and then recreating them to randomly switch the keys, but that crashes the game since (I'm assuming from what I saw In the error logs) some Vanilla values can't be NULL.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.