Datapack Commands

Quick rating

Community listing page, reviews here may not be monitored by the author.

Datapack Commands

By Charken Inc. , Jacob0225

No reviews yet

A Datapack Tool that allows datapacks to have custom commands

Mod Loaders
Minecraft
26.3 26.2

About

Description

Datapack Commands Logo

A Fabric mod for Minecraft 1.21.11 that lets datapack creators create custom slash commands that execute datapack functions. Commands are registered at runtime, persist across restarts, and show up in tab completion for all players — no server restart required.


How to Use

All management is done through the /cgen command, which requires operator level 4.

Creating a command

/cgen create <commandname> <namespace:function>

(Subcommands are also possible)

/cgen create "<commandname> <arg> <etc>" <namespace:function>

Registers a new /<commandname> that runs the specified datapack function when used. The command is available to all players immediately. If using a subcommand make sure to add a " around the main command and subcommand

Example:

/cgen create ""spawn zombie"" example:spawn_zombie

Players can now run /spawn zombie and it will execute example:spawn_zombie.


Removing a command

/cgen remove <commandname>

Unregisters the command immediately. Tab complete will suggest your registered commands after typing /cgen remove.

Example:

/cgen remove spawn

Listing commands

/cgen list

Shows all currently registered commands and the functions they map to.

Example output:

Registered commands:
  /fasterpathsload -> fasterpaths:load
  /heal -> utils:heal_player

Feedback toggle (default is off)

/cgen feedback on
/cgen feedback off

Controls whether the "Executed function: ..." message appears in chat when a player runs a custom command. Defaults to off. This setting persists across restarts.


Check

/cgen check

Returns 1 if the mod is running correctly. Useful for datapacks that want to verify that the mod is loaded.


Notes

  • Commands are saved to <world folder>/datapackcommands.json and automatically re-registered on server start.
  • The datapack function itself can still send its own chat messages (e.g. via tellraw) regardless of the feedback setting.
  • Command names must be alphanumeric with underscores, up to 32 characters.
  • Function names must follow the standard namespace:path format.

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.


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