-
Notifications
You must be signed in to change notification settings - Fork 0
Events
SpokenWig620933 edited this page Aug 15, 2026
·
14 revisions
Events are how KubeJS runs everything.
- MODIFICATION > KeyBindExtendedEvents.modification
- CATEGORIES > KeyBindExtendedEvents.categories
Used to modify KeyBinds!
- getKeyMapping(String name)
- hide(String name)
- remove(String name)
- resetKey(String name)
- setCategory(String name, String category)
- setDefaultKey(String name, String key)
- setDefaultKeyWithModifier(String name, String key, String modifier)
- setKey(String name, String key)
- setKeyWithModifier(String name, String key, String modifier)
KeyBindExtendedEvents.modification(event => {
// Retrieves KeyMapping for the Attack KeyBind and logs its Category!
console.log(event.getKeyMapping('key.attack').getCategory());
});
KeyBindExtendedEvents.modification(event => {
// Hides the Command KeyBind from Controls, but does not clear its Assigned Key!
event.hide('key.command');
});
KeyBindExtendedEvents.modification(event => {
// Functionally removes the Cinematic Camera KeyBind from the game!
event.remove('key.smoothCamera');
});
KeyBindExtendedEvents.modification(event => {
// Resets the Command KeyBind to its Default Key!
event.resetKey('key.command');
});
KeyBindExtendedEvents.modification(event => {
// Moved the Highlight Players (Spectator) KeyBind to a custom Debug category!
event.setCategory('key.spectatorOutlines', 'key.categories.debug');
});
KeyBindExtendedEvents.modification(event => {
// Sets the Default Key for the Load Hotbar Activator KeyBind to V!
event.setDefaultKey('key.loadToolbarActivator', 'KEY_V');
});
KeyBindExtendedEvents.modification(event => {
// Sets the Default Key + Modifier for the Toggle Fullscreen KeyBind to ALT + F11!
event.setDefaultKeyWithModifier('key.fullscreen', 'KEY_F11', 'ALT');
});
KeyBindExtendedEvents.modification(event => {
// Overrides the List Players KeyBind EVERY Launch to TAB!
event.setKey('key.playerlist', 'KEY_TAB');
});
KeyBindExtendedEvents.modification(event => {
// Overrides the Social Interactions Screen KeyBind EVERY Launch to ALT + P!
event.setKeyWithModifier('key.socialInteractions', 'KEY_P', 'ALT');
});
Used to modify KeyBind Categories!
KeyBindExtendedEvents.categories(event => {
// Moves the Creative KeyBind Category to the top!
event.setDisplayIndex('key.categories.creative', 0);
});
KeyBindExtendedEvents.categories(event => {
// Removed the category by removing ALL KeyBinds using it!
event.removeCategory('key.categories.creative');
});
KeyBindExtendedEvents.categories(event => {
// Logs a List<String> of all sorted categories in the order they will be sorted in!
event.getCategoriesInOrder().forEach(category => {
console.log('Categories in Order: ' + category);
});
});