-
Notifications
You must be signed in to change notification settings - Fork 0
Bindings
SpokenWig620933 edited this page Aug 15, 2026
·
8 revisions
Used to expose Utils to use during Events.
Bindings can be used in any Events!
A Utility Class for Events.
- isOptionsSaved
- getKeyMappings
- getAvailableKeyMappings
- getKeyMapping
- getKeyMappingNames
- getKeyMappingCategories
- getKeys
- getKeyNames
- getKeyModifiers
KeyBindExtendedEvents.modification(event => {
// Determines if the Options.txt file already exists!
if(KeyBind.isOptionsSaved()) {
// Overrides the KeyBind on First Launch to Not Bound!
event.setKey('key.socialInteractions', 'KEY_UNKNOWN')
}
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<KeyMapping> of all KeyMappings!
KeyBind.getKeyMappings().forEach(keyMapping => {
// Logs the KeyMapping's name!
console.log('KeyMapping: ' + keyMapping.getName());
});
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<KeyMapping> of all Available KeyMappings in Controls!
KeyBind.getAvailableKeyMappings().forEach(keyMapping => {
// Logs the KeyMapping's name!
console.log('KeyMapping: ' + keyMapping.getName());
});
});
KeyBindExtendedEvents.categories(event => {
// Sets the Order for the Category of the Attack/Destroy KeyBind to the Top!
event.setDisplayIndex(KeyBind.getKeyMapping('key.attack').getCategory(), 0);
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<String> of all KeyMapping Names!
KeyBind.getKeyMappingNames().forEach(key => {
// Logs the Key Name!
console.log('KeyMapping: ' + key);
});
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<String> of all KeyMapping categories!
KeyBind.getKeyMappingCategories().forEach(category => {
// Logs the Category!
console.log('Category: ' + category);
});
});
KeyBindExtendedEvents.modification(event => {
// Returns a Map of Key Names to KeyCodes!
KeyBind.getKeys().forEach((key, keyCode) => {
// Logs the Key Name with it's KeyCode!
console.log('Key: ' + key + '; KeyCode: ' + keyCode);
});
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<String> of all Key Names!
KeyBind.getKeyNames().forEach(key => {
// Logs the Key Name!
console.log('Key: ' + key);
});
});
KeyBindExtendedEvents.modification(event => {
// Returns a List<String> of all Key Modifiers!
KeyBind.getKeyModifiers().forEach(modifier => {
// Logs the Key Modifier!
console.log('Modifier: ' + modifier);
});
});
Contains Default Key Conflict Contexts
KeyBindExtendedEvents.modification(event => {
event.setKeyConflictContext('key.drop', KeyConflictContext.UNIVERSAL);
});
KeyBindExtendedEvents.modification(event => {
event.setKeyConflictContext('key.swapOffhand', KeyConflictContext.GUI);
});
KeyBindExtendedEvents.modification(event => {
event.setKeyConflictContext('key.sneak', KeyConflictContext.IN_GAME);
});