#is there a way to create custom keybinds?

14 messages · Page 1 of 1 (latest)

torpid thicket
#

examples from previous versions don't seems to work

lean dirgeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

hollow abyss
#

the previous version examples will probably eb a good starting point. how dont they work?

torpid thicket
#

@hollow abyss been using this in client_scripts

const $KeyMappingRegistry = Java.loadClass('dev.architectury.registry.client.keymappings.KeyMappingRegistry')
const $KeyMapping = Java.loadClass('net.minecraft.client.KeyMapping')
const $GLFWKey = Java.loadClass('org.lwjgl.glfw.GLFW')

ClientEvents.init(event => {
    global.HKEY = new $KeyMapping('key.kubejs.hkey', $GLFWKey.GLFW_KEY_H, 'key.categories.kubejs')
    $KeyMappingRegistry.register(global.HKEY)
})

and gives me this error

hollow abyss
#

oh yeah that wont do very well cause it uses arch and kjs no longer uses that now

torpid thicket
#

i'm just dumb too

#

the keybind registery worked and the usage too

#

now i'm trying to find how to create custom chests gui, if possible

hollow abyss
#

ive been meaning to do an example of those

torpid thicket
#

I'm almost at it, I think

#

just having one error in container arg initialization

gray sentinel
#

I could try to make KeyJS to make keybind stuff easier or something

torpid thicket
#

that's cool

#

code that worked for 1.21.1, closing thread

const $KeyMappingRegistry = Java.loadClass('dev.architectury.registry.client.keymappings.KeyMappingRegistry')
const $KeyMapping = Java.loadClass('net.minecraft.client.KeyMapping')
const $GLFWKey = Java.loadClass('org.lwjgl.glfw.GLFW')
global.HKEY = new $KeyMapping('key.kubejs.hkey', $GLFWKey.GLFW_KEY_H, 'key.categories.kubejs')

StartupEvents.init(event => {
    $KeyMappingRegistry.register(global.HKEY)
})