Evo API Draft
  • Java
    • Intro
    • Imports
    • Constructing Objects
    • Properties
    • Type Annotations
    • Conversions
    • Explicit Conversions
    • Behaviors
    • Creating and Extending Types
    • Promises
  • mc-std
    • Intro
    • Commands
Powered by GitBook
On this page
  1. mc-std

Commands

Creating commands in mc-std

In mc-std, you can easily create commands by importing the commands module.

import commands from 'mc-std/commands';
import { broadcast } from 'mc-std/server';

commands.register({
    name: 'name',
    label: 'label',
    metadata: {
        usage: 'usage',
        description: 'description'
    },
    permissions: {
        permission: 'my.permission',
        failMessage: 'You cannot use this command.'
    },
    run(sender, ...args: string[]) {
        broadcast(`${sender} used args ${args.join(', ')}`);
    }
});
PreviousIntro

Last updated 1 year ago