Commander API – Bedrock Addon
Commander API is a lightweight library addon for Minecraft Bedrock that makes it easier to create custom commands using the scripting engine.
Instead of writing complex event listeners every time, this API provides a simple way to register commands with names, aliases, permissions, and usage messages.
With Commander API, you can:
-
Register your own custom commands in just a few lines of code.
-
Add aliases (e.g.,
/pingor/p). -
Restrict commands with permission tags (e.g., only players with
commander.opcan run). -
Easily reply to players or broadcast messages with built-in helpers.
-
Use it as a dependency in your other addons for a unified command system.
Installation
-
Download the
CommanderAPI.mcpack. -
Double-click it, or move it into your Minecraft
behavior_packsfolder. -
Open your world settings → Behavior Packs → activate Commander API.
-
Turn on "Enable Experimental Gameplay" and scripting options.
Included Example Commands
-
/ping (alias
/p) → Replies withPONG. -
/echo → Repeats whatever text you provide.
-
/settag → Adds the tag
commander.opto the target. Requires you to have thecommander.admintag.
Permissions
Commander API uses tag-based permissions:
-
any→ anyone can run the command. -
tag:<tagname>→ only players with that tag can run it.
For example:
/tag Master add commander.op
This would grant you permission to run commands that require the commander.op tag.
How to Use in Your Own Addons
-
Add Commander API as a dependency in your addon’s manifest.
-
Import the API in your script:
import { Commander } from "commander_api.js"; -
Register commands:
Commander.registerCommand({ name: "heal", description: "Heals yourself", permission: "tag:commander.op" }, (ctx) => { ctx.runAs(`effect ${ctx.senderName} instant_health 1 255 true`); ctx.reply("You have been healed!"); });
Notes
-
This is a behavior pack only (no resource pack required).
-
Requires Minecraft Bedrock 1.19.50+ with scripting enabled.
-
Tags can be used to manage operator-like permissions without giving players full OP status.
-
Designed for server owners, addon developers, and advanced players who want custom commands.