Skip to content

API reference / @jsprismarine/prismarine / command/CommandManager

command/CommandManager ​

Classes ​

Interfaces ​

CommandReference ​

Defined in: packages/prismarine/src/command/CommandManager.ts:106

One command as CommandManager.commandReference describes it.

Properties ​

aliases ​

aliases: readonly string[]

Defined in: packages/prismarine/src/command/CommandManager.ts:109

description? ​

optional description?: string

Defined in: packages/prismarine/src/command/CommandManager.ts:108

moreUsage? ​

optional moreUsage?: boolean

Defined in: packages/prismarine/src/command/CommandManager.ts:118

True when the command takes more forms than usage lists, which /help caps too.

name ​

name: string

Defined in: packages/prismarine/src/command/CommandManager.ts:107

usage ​

usage: readonly string[]

Defined in: packages/prismarine/src/command/CommandManager.ts:111

The forms the command takes, from its name, such as teleport <targets> <position>.

usageWords ​

usageWords: readonly (readonly ArgumentWords[])[]

Defined in: packages/prismarine/src/command/CommandManager.ts:116

For each form in usage, how many typed words each part after the name reads: three for a position, rest for a message. A console counts words to find the argument being typed.


CommandSuggestions ​

Defined in: packages/prismarine/src/command/CommandManager.ts:94

What a command line could go on with: the span of the line the suggestions replace, and each one.

Properties ​

length ​

readonly length: number

Defined in: packages/prismarine/src/command/CommandManager.ts:96

matches ​

readonly matches: readonly object[]

Defined in: packages/prismarine/src/command/CommandManager.ts:97

start ​

readonly start: number

Defined in: packages/prismarine/src/command/CommandManager.ts:95


PlayerCommandSender ​

Defined in: packages/prismarine/src/command/CommandManager.ts:57

A player who sent a command, as the dispatch reads one: the entity a vanilla command runs as, and the operator status and permissions it is gated by.

Extends ​

Properties ​

pitch ​

readonly pitch: number

Defined in: packages/prismarine/src/command/host/support.ts:188

Inherited from ​

ReferencedEntity.pitch

yaw ​

readonly yaw: number

Defined in: packages/prismarine/src/command/host/support.ts:187

Inherited from ​

ReferencedEntity.yaw

Methods ​

getCommandLevel() ​

getCommandLevel(): CommandPermissionLevel

Defined in: packages/prismarine/src/command/CommandManager.ts:66

The level the sender runs commands at: the level meta, or 4 for an operator.

Returns ​

CommandPermissionLevel

getFeetY() ​

getFeetY(): number

Defined in: packages/prismarine/src/command/host/support.ts:186

Returns ​

number

Inherited from ​

ReferencedEntity.getFeetY

getFormattedUsername() ​

getFormattedUsername(): string

Defined in: packages/prismarine/src/command/CommandExecutor.ts:32

Get the formatted username of the executor.

Returns ​

string

The formatted username of the executor.

Inherited from ​

CommandExecutor.getFormattedUsername

getName() ​

getName(): string

Defined in: packages/prismarine/src/command/CommandExecutor.ts:26

Get the name of the executor.

Returns ​

string

The name of the executor.

Inherited from ​

CommandExecutor.getName

getPermissions() ​

getPermissions(): string[]

Defined in: packages/prismarine/src/command/CommandManager.ts:64

Every node that applies to the sender, as the permission entries name them.

Returns ​

string[]

getPosition() ​

getPosition(): object

Defined in: packages/prismarine/src/command/host/support.ts:185

Returns ​

object

getX() ​

getX(): number

Returns ​

number

getZ() ​

getZ(): number

Returns ​

number

Inherited from ​

ReferencedEntity.getPosition

getRuntimeId() ​

getRuntimeId(): bigint

Defined in: packages/prismarine/src/command/host/support.ts:182

Returns ​

bigint

Inherited from ​

ReferencedEntity.getRuntimeId

getServer() ​

getServer(): Server

Defined in: packages/prismarine/src/command/CommandExecutor.ts:38

Get the server instance.

Returns ​

Server

The server instance.

Inherited from ​

CommandExecutor.getServer

getType() ​

getType(): string

Defined in: packages/prismarine/src/command/host/support.ts:183

Returns ​

string

Inherited from ​

ReferencedEntity.getType

getWorld() ​

getWorld(): World

Defined in: packages/prismarine/src/command/host/support.ts:189

Returns ​

World

Inherited from ​

ReferencedEntity.getWorld

hasPermission() ​

hasPermission(node): boolean

Defined in: packages/prismarine/src/command/CommandManager.ts:60

Whether the sender holds a node after resolution.

Parameters ​
node ​

string

Returns ​

boolean

isOp() ​

isOp(): boolean

Defined in: packages/prismarine/src/command/CommandManager.ts:58

Returns ​

boolean

permissionDecision() ​

permissionDecision(node): boolean | undefined

Defined in: packages/prismarine/src/command/CommandManager.ts:62

The sender's grant (true) or negation (false) of a node, or undefined when no entry names it.

Parameters ​
node ​

string

Returns ​

boolean | undefined

sendMessage() ​

sendMessage(message): void | Promise<void>

Defined in: packages/prismarine/src/command/CommandExecutor.ts:20

Send a message to the executor.

Delivery is asynchronous for a player, whose message goes out over the wire, and synchronous for the console, which writes to a terminal. Callers may await either.

Parameters ​
message ​

string

The message to send.

Returns ​

void | Promise<void>

Inherited from ​

CommandExecutor.sendMessage

Functions ​

commandPermissionOf() ​

commandPermissionOf(name): string

Defined in: packages/prismarine/src/command/CommandManager.ts:134

The permission node a command is gated by.

The command layer carries a CommandPermissionLevel; this server gates on named nodes. A vanilla command's node is minecraft.command.<name>, so a permissions.json that granted minecraft.command.me still grants it, and this server's own commands keep the nodes in JSPRISMARINE_COMMAND_PERMISSIONS.

Parameters ​

name ​

string

Returns ​

string