interface command { use %world.{%world}; use entity.{entity}; use player.{player}; use block-entity.{command-block-entity}; use common.{position, block-position, locale}; use server.{server, difficulty}; use text.{text-component}; enum gamemode { survival, creative, adventure, spectator, } enum bossbar-color { pink, blue, red, green, yellow, purple, white, } enum bossbar-style { no-division, notches6, notches10, notches12, notches20, } enum sound-category { master, music, records, weather, blocks, hostile, neutral, players, ambient, voice, ui, } enum entity-anchor { feet, eyes, } variant number { float64(f64), float32(f32), int32(s32), int64(s64), } variant not-in-bounds { lower-bound(tuple), upper-bound(tuple), } variant arg { entities(list), entity(entity), players(list), block-pos(block-position), pos3d(position), pos2d(tuple), rotation(tuple), game-mode(gamemode), difficulty(difficulty), item(string), item-predicate(string), resource-location(string), block(string), block-predicate(string), bossbar-color(bossbar-color), bossbar-style(bossbar-style), particle(string), msg(string), text-component(text-component), time(s32), num(result), %bool(bool), simple(string), sound-category(sound-category), damage-type(string), effect(string), enchantment(string), entity-anchor(entity-anchor), } resource consumed-args { get-value: func(key: string) -> arg; } variant command-sender-type { rcon, console, player(player), command-block(tuple), dummy, } enum permission-level { zero, one, two, three, four, } resource command-sender { get-command-sender-type: func() -> command-sender-type; send-message: func(text: text-component); set-success-count: func(count: s32); is-player: func() -> bool; is-console: func() -> bool; as-player: func() -> option; permission-level: func() -> permission-level; has-permission-level: func(level: permission-level) -> bool; has-permission: func(server: borrow, node: string) -> bool; position: func() -> option; %world: func() -> option<%world>; get-locale: func() -> locale; should-receive-feedback: func() -> bool; should-broadcast-console-to-ops: func() -> bool; should-track-output: func() -> bool; } enum string-type { single-word, quotable, greedy, } variant argument-type { %bool, float(tuple, option>), double(tuple, option>), integer(tuple, option>), long(tuple, option>), %string(string-type), entities, entity, %players, game-profile, block-pos, position3d, position2d, block-state, block-predicate, item, item-predicate, component, rotation, %resource-location, entity-anchor, gamemode, difficulty, time(s32), %resource(string), } variant command-error { invalid-consumption(option), invalid-requirement, permission-denied, command-failed(text-component), } resource command-node { literal: static func(name: string) -> command-node; argument: static func(name: string, arg-type: argument-type) -> command-node; then: func(node: command-node); execute-with-handler-id: func(handler-id: u32); require-with-handler-id: func(handler-id: u32); } resource command { /// First name is primary, rest are aliases constructor(names: list, description: string); then: func(node: command-node); execute-with-handler-id: func(handler-id: u32); } }