#I cant set a keybind for my vehicle flying

2 messages · Page 1 of 1 (latest)

smoky relic
#
private static final KeyBinding keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
        "key.cysticsvehicles.flyup", // The translation key of the keybinding's name
        InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse.
        GLFW.GLFW_KEY_SPACE, // The keycode of the key
        "category.cysticsvehicles.ufo" // The translation key of the keybinding's category.
    ));

    @Override
    protected void tickControlled(PlayerEntity controllingPlayer, Vec3d movementInput) {
        super.tickControlled(controllingPlayer, movementInput);
        
        if (this.isLogicalSideForUpdatingMovement()) {
            if (keyBinding.isPressed()) {
                this.setVelocity(movementInput.x, 0.1f, movementInput.z);
            }
        }
    }

My vehicle just doesnt spawn now that i did this