Datapack Commands

Datapack Commands

Turn any datapack function into a real slash command!

1 874 downloads 4 followers

Datapack Commands Logo

Datapack Commands

Your commands, your rules.

Turn any datapack function into a real slash command — no client mod, no restart, no hassle. Players get tab completion out of the box. You stay in control.

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/_odjvTNqSIY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

What it does

/cgen create heal utils:heal_player — that's it.
Players can now type /heal and your datapack function runs. Instantly. For everyone.

Commands persist across restarts, show up in tab completion, and can be removed just as easily.


Commands

/cgen create <name> <namespace:function>

Registers a new slash command that runs a datapack function.

/cgen create heal utils:heal_player
/cgen create "shop haste" mypack:give_haste

Players can now type /heal or /shop haste — no client mod needed.


/cgen remove <name>

Unregisters a command immediately. Gone from tab completion too.

/cgen remove heal

/cgen list

Shows all registered commands and what they map to.

Registered commands:
  /heal  ->  utils:heal_player
  /shop  ->  mypack:open_shop

/cgen feedback <on|off>

Toggle whether "Executed function: ..." appears in chat when a command is used.
Off by default. Persists across restarts.


/cgen check

Returns 1 if the mod is loaded. Use this in your datapack to verify Datapack Commands is running.


Good to know

  • Requires operator level 4 to use /cgen
  • Registered players (without OP) can use the created commands freely
  • Commands are saved to "world"/datapackcommands.json
  • Command names: alphanumeric + underscores, max 32 characters
  • This should pair well with Filiment

Server-side only — players don't need to install anything.

This Mod may be used in modpacks and as dependencies for any datapacks/mods

Version Minecraft Loader Download

1.0.1

1.0.1-26.3

26.3
fabric
Download

1.0.1

1.0.1-26.2

26.2
fabric
Download

1.0.0 26.2

1.0.0

26.2
fabric
Download

1.0.0 1.21.1 Neoforge

1.0.0

1.21, 1.21.1
neoforge
Download

1.0.0 26.1+

1.0.0

26.1, 26.1.1, 26.1.2
fabric, quilt
Download

1.0.0 1.20.5-1.21.11

1.0.0

1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.10, 1.21.11, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9
fabric, quilt
Download