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., /ping or /p).
-
Restrict commands with permission tags (e.g., only players with commander.op can 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_packs folder.
-
Open your world settings → Behavior Packs → activate Commander API.
-
Turn on "Enable Experimental Gameplay" and scripting options.
Included Example Commands
-
/ping (alias /p) → Replies with PONG.
-
/echo → Repeats whatever text you provide.
-
/settag → Adds the tag commander.op to the target. Requires you to have the commander.admin tag.
Permissions
Commander API uses tag-based permissions:
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.