List of Events
This is a list of all events. It's possible that not all events are listed here, but this list will be updated regularly.
Click on event ID to open its class and see information, fields, and methods.
Type descriptions:
- Startup: scripts go into the
/kubejs/startup_scripts/
folder. Startup scripts run once, at startup, on both the client and server. Most events that require registering or modifying something at game start (like custom blocks, items, and fluids) will be Startup events. - Server: scripts go into the
/kubejs/server_scripts/
folder. It will be reloaded when you run/reload
command. Server events are always accessible, even in single-player worlds. Most events that make changes to the world while the game is running (such as breaking blocks, teleporting players, or adding recipes) will go here. - Server Startup: same as Server, and the event will be fired at least once when the server loads.
- Client: scripts go into the
/kubejs/client_scripts/
folder. Will be reloaded when you pressF3+T
. Most changes that are per-client (such as resource packs, Painter, and JEI) are client events. - Client Startup: Same as Client, and the event will be fired at least once when the client loads.
Base KubeJS Events
Folder | Method | Cancellable |
/startup_scripts/ |
StartupEvents.init (link) |
❌ |
/startup_scripts/ |
StartupEvents.postInit (link) |
❌ |
/startup_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
ClientEvents.paintScreen (link) |
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
❌ |
/server_scripts/ |
|
✅ |
/server_scripts/ |
ServerEvents.customCommand (link) |
✅ |
/server_scripts/ |
ServerEvents.recipes (link) |
❌ |
/server_scripts/ |
ServerEvents.afterRecipes (link) |
❌ |
/server_scripts/ |
ServerEvents.specialRecipeSerializers (link) |
❌ |
/server_scripts/ |
ServerEvents.compostableRecipes (link) |
❌ |
/server_scripts/ |
ServerEvents.recipeTypeRegistry (link) |
❌ |
/server_scripts/ |
ServerEvents.genericLootTables (link) |
❌ |
/server_scripts/ |
ServerEvents.blockLootTables (link) |
❌ |
/server_scripts/ |
ServerEvents.entityLootTables (link) |
❌ |
/server_scripts/ |
ServerEvents.giftLootTables (link) |
❌ |
/server_scripts/ |
ServerEvents.fishingLootTables (link) |
❌ |
/server_scripts/ |
ServerEvents.chestLootTables (link) |
❌ |
/server_scripts/ |
LevelEvents.loaded (link) |
❌ |
/server_scripts/ |
LevelEvents.unloaded (link) |
❌ |
/server_scripts/ |
LevelEvents.tick (link) |
❌ |
/server_scripts/ |
LevelEvents.beforeExplosion (link) |
✅ |
/server_scripts/ |
LevelEvents.afterExplosion (link) |
❌ |
/startup_scripts/ |
WorldgenEvents.add (link) |
❌ |
/startup_scripts/ |
WorldgenEvents.remove (link) |
❌ |
/client_scripts/ |
NetworkEvents.fromServer (link) |
✅ |
/server_scripts/ |
NetworkEvents.fromClient (link) |
✅ |
/startup_scripts/ |
ItemEvents.modification (link) |
❌ |
/startup_scripts/ |
ItemEvents.toolTierRegistry (link) |
❌ |
/startup_scripts/ |
ItemEvents.armorTierRegistry (link) |
❌ |
/server_scripts/ |
ItemEvents.rightClicked (link) |
✅ |
/server_scripts/ |
ItemEvents.canPickUp (link) |
✅ |
/server_scripts/ |
ItemEvents.pickedUp (link) |
❌ |
/server_scripts/ |
ItemEvents.dropped (link) |
✅ |
/server_scripts/ |
ItemEvents.entityInteracted (link) |
✅ |
/server_scripts/ |
ItemEvents.crafted (link) |
❌ |
/server_scripts/ |
ItemEvents.smelted (link) |
❌ |
/server_scripts/ |
ItemEvents.foodEaten (link) |
✅ |
/client_scripts/ |
ItemEvents.tooltip (link) |
❌ |
/startup_scripts/ |
ItemEvents.modelProperties (link) |
❌ |
/client_scripts/ |
ItemEvents.clientRightClicked (link) |
❌ |
/client_scripts/ |
ItemEvents.clientLeftClicked (link) |
❌ |
/server_scripts/ |
ItemEvents.firstRightClicked (link) |
❌ |
/server_scripts/ |
ItemEvents.firstLeftClicked (link) |
❌ |
/startup_scripts/ |
BlockEvents.modification (link) |
❌ |
/server_scripts/ |
BlockEvents.rightClicked (link) |
✅ |
/server_scripts/ |
BlockEvents.leftClicked (link) |
✅ |
/server_scripts/ |
BlockEvents.placed (link) |
✅ |
/server_scripts/ |
BlockEvents.broken (link) |
✅ |
/server_scripts/ |
BlockEvents.detectorChanged (link) |
❌ |
/server_scripts/ |
BlockEvents.detectorPowered (link) |
❌ |
/server_scripts/ |
BlockEvents.detectorUnpowered (link) |
❌ |
/server_scripts/ |
BlockEvents.farmlandTrampled (link) |
❌ |
/server_scripts/ |
EntityEvents.death (link) |
✅ |
/server_scripts/ |
EntityEvents.hurt (link) |
✅ |
/server_scripts/ |
EntityEvents.checkSpawn (link) |
✅ |
/server_scripts/ |
EntityEvents.spawned (link) |
✅ |
/server_scripts/ |
PlayerEvents.loggedIn (link) |
❌ |
/server_scripts/ |
PlayerEvents.loggedOut (link) |
❌ |
/server_scripts/ |
PlayerEvents.respawned (link) |
❌ |
/server_scripts/ |
PlayerEvents.tick (link) |
❌ |
/server_scripts/ |
PlayerEvents.chat (link) |
✅ |
/server_scripts/ |
PlayerEvents.decorateChat (link) |
❌ |
/server_scripts/ |
PlayerEvents.advancement (link) |
✅ |
/server_scripts/ |
PlayerEvents.inventoryOpened (link) |
❌ |
/server_scripts/ |
PlayerEvents.inventoryClosed (link) |
❌ |
/server_scripts/ |
PlayerEvents.inventoryChanged (link) |
❌ |
/server_scripts/ |
PlayerEvents.chestOpened (link) |
❌ |
/server_scripts/ |
PlayerEvents.chestClosed (link) |
❌ |
Mod Compatibility
These events are enabled when certain other mods are present.
Just Enough Items (JEI)
Folder | Method | Cancellable |
/client_scripts/ |
JEIEvents.subtypes (source) |
❌ |
/client_scripts/ |
JEIEvents.hideItems (source) |
❌ |
/client_scripts/ |
|
❌ |
/client_scripts/ |
JEIEvents.hideCustom (source) |
❌ |
/client_scripts/ |
JEIEvents.removeCategories (source) |
❌ |
/client_scripts/ |
JEIEvents.removeRecipes (source) |
❌ |
/client_scripts/ |
JEIEvents.addItems (source) |
❌ |
/client_scripts/ |
JEIEvents.addFluids (source) |
❌ |
/client_scripts/ |
JEIEvents.information (source) |
❌ |
Roughly Enough Items (REI)
Folder | Method | Cancellable |
/client_scripts/ |
REIEvents.hide (source) |
❌ |
/client_scripts/ |
REIEvents.add (source) |
❌ |
/client_scripts/ |
REIEvents.information (source) |
❌ |
/client_scripts/ |
REIEvents.removeCategories (source) |
❌ |
/client_scripts/ |
REIEvents.groupEntries (source) |
❌ |
GameStages
Folder | Method | Cancellable |
/server_scripts/ |
GameStageEvents.stageAdded (source) |
❌ |
/server_scripts/ |
GameStageEvents.stageRemoved (source) |
❌ |