Skip to content
Hosting · Mods and modpacks

KubeJS: custom recipes and scripts

Changing modpack recipes and mechanics without programming: KubeJS script structure, reloading, and common mistakes.

Updated August 13, 2026

KubeJS lets you change a modpack with scripts: remove and add recipes, change drops, hook events. This is the standard way to balance a modpack.

Structure

kubejs/
  server_scripts/   recipes, drops, server events
  client_scripts/   tooltips, interface
  startup_scripts/  item and block registration

Server scripts are what you need on hosting.

Examples

ServerEvents.recipes(event => {
  event.remove({ output: 'minecraft:diamond_block' })
  event.shaped('4x minecraft:stick', [
    'P',
    'P'
  ], { P: 'minecraft:oak_planks' })
})

Reload

/kubejs reload server_scripts

Recipes apply without a restart. Startup scripts require a full restart.

Errors

Script errors are written to logs/kubejs/server.txt, not just to the general log. Check there first: the server will still start, but your changes simply won't apply.

Caution

  • The script runs on the server with full permissions — don't copy other people's scripts without looking at them.
  • Removing a recipe that's used in a modpack quest chain breaks player progress.
  • Events that fire every tick or every block easily tank TPS — Modded server optimization.
Minecraft hostingYour server runs while you are offlineCreate server