promotional bannermobile promotional banner

Commander API

a libary addon for custom commands

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

  1. Download the CommanderAPI.mcpack.

  2. Double-click it, or move it into your Minecraft behavior_packs folder.

  3. Open your world settings → Behavior Packs → activate Commander API.

  4. 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:

  • 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

  1. Add Commander API as a dependency in your addon’s manifest.

  2. Import the API in your script:

    import { Commander } from "commander_api.js";
    
  3. 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.

The Commander API Team

profile avatar
  • 16
    Followers
  • 15
    Projects
  • 13.1K
    Downloads

More from RazorBladeZ_View all