Skip to content
On this page

From Datapack to Katton

If you already know vanilla datapacks, Katton should feel familiar: you still reload quickly, you can still call command-like helpers, and you can keep existing .mcfunction files while moving the parts that need real code into Kotlin.

The big difference is that Katton lets you stop encoding all logic as command strings. You can write functions, store values in variables, react to events, work with real entity objects, and use hot-reloadable APIs that reach far beyond vanilla datapacks.

NOTE

Paper supports server-side datapack-style APIs and events, but it cannot register custom items, blocks, entities, or client features because a vanilla client cannot receive those registry entries.

Migration Map

Datapack habitKatton replacementStart here
data/<namespace>/function/*.mcfunction.kt files with @ServerScriptEntrypoint functionsProject Structure
Long command chainsKotlin functions, loops, and command helpersTranslating mcfunction to Kotlin
Vanilla commandstop.katton.api.dpcaller helpersCalling Vanilla Commands
@e[...], @a[...]EntitySelectorBuilder and real entity objectsSelectors and Entity Access
Scoreboards, tags, NBT, storageScoreboards when useful, Kotlin values for logic, NBT APIs for data accessScoreboards, Tags, NBT, and Storage
#load, #tick, schedule functionServer lifecycle and tick eventsReplacing Load, Tick, and Schedule
Recipe and loot JSON editsmodifyRecipe, modifyLootTable, and related APIsRecipes, Loot Tables, and Datapack Mutations
Existing datapack librariesKeep them and call runFunction while migrating graduallyKeeping Existing Datapacks
Datapack limitationsEvents, registries, client rendering, injection, pack UIGoing Beyond Datapacks

A Good First Migration

Start with a small utility function, not your entire datapack. Pick something that is annoying in .mcfunction, such as a selector-heavy loop, a scoreboard calculation, or a command chain that needs branching.

  1. Create a script pack.
  2. Add one @ServerScriptEntrypoint function.
  3. Recreate the behavior in Kotlin.
  4. Reload with /katton reload.
  5. Keep the rest of the datapack unchanged until the new script feels solid.