Command

public final class Command

Constructors

Link copied to clipboard
public Command Command(String name, String aliases, CommandCondition requirement, PermissionCommandCondition permissionRequirement)

Properties

Link copied to clipboard
private final String name
Link copied to clipboard
Link copied to clipboard
private final LiteralArgumentBuilder<CommandSourceStack> root

Functions

Link copied to clipboard
public final Unit aliases(String aliases)
Link copied to clipboard
public final Unit buildSyntax(CommandNode args, Function1<CommandSyntaxDSL, Unit> block)
Link copied to clipboard
public final Unit defaultExecutor(Function2<CommandExecutorContext, CommandSender, Unit> block)
public final Unit defaultExecutor(Function3<CommandExecutorContext, CommandSender, CommandContext<CommandSourceStack>, Unit> block)
Link copied to clipboard
public final Unit description(String description)
Link copied to clipboard
public final String getName()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public final LiteralArgumentBuilder<CommandSourceStack> getRoot()
Link copied to clipboard
public final Unit onlyConsole()

Adds a requirement to the command syntax that only allows the console to execute the command.

Link copied to clipboard
public final Unit onlyPlayers()

Adds a requirement to the command syntax that only allows players to execute the command.

Link copied to clipboard
public final Unit permission(String permission)

Adds a requirement to the command syntax that only allows senders with the specified permission to execute the command.

Link copied to clipboard
public final Unit requires(CommandCondition predicate)

Adds a requirement to the command syntax. If a requirement already exists, the new requirement will be combined with the existing one using a logical AND.

Link copied to clipboard
Link copied to clipboard
public final Unit setRequirement(CommandCondition value)
Link copied to clipboard
public final Unit subcommand(Command child)
public final Unit subcommand(String name, String aliases, Function1<Command, Unit> block)