Package-level declarations

Velocity integration layer for the core DSL.

Types

Link copied to clipboard
data class KraftlinVelocityCommand(val node: LiteralCommandNode<VelocitySource>, val description: String?, val aliases: List<String>)

A built command ready for registration via registerKraftlinCommands.

Link copied to clipboard

ArgumentNode specialized to Velocity's CommandSource.

Link copied to clipboard

KContext specialized to Velocity's CommandSource.

Link copied to clipboard

ExecuteScope specialized to Velocity's CommandSource.

Link copied to clipboard

LiteralNode specialized to Velocity's CommandSource.

Link copied to clipboard

Velocity platform adapter for cross-platform command definitions.

Link copied to clipboard
typealias VelocitySource = CommandSource

Velocity's Brigadier command source type.

Properties

Link copied to clipboard
val VelocityContext.sender: CommandSource

The CommandSource who executed the command.

Functions

Link copied to clipboard

Execution handler that extracts the CommandSource before invoking block.

Link copied to clipboard

Execution handler restricted to Player senders. Throws a command error if the sender is not a player.

Link copied to clipboard

Execution handler with custom result code, restricted to Player senders.

Link copied to clipboard

Execution handler with custom result code that extracts the CommandSource.

Link copied to clipboard
fun kraftlinCommand(name: String, description: String? = null, aliases: List<String> = emptyList(), block: VelocityLiteralNode.() -> Unit): KraftlinVelocityCommand

Declares a new Kraftlin command for Velocity.

Link copied to clipboard
fun CommandManager.registerKraftlinCommands(vararg commands: KraftlinVelocityCommand)

Registers one or more Kraftlin commands with this command manager.

Link copied to clipboard

Returns the sender as a Player, or throws a command error if the sender is not a player.

Link copied to clipboard

Requires the sender to have the given permission.

Link copied to clipboard

Requires the sender to be a Player.

Link copied to clipboard
fun VelocityLiteralNode.requiresSender(predicate: (CommandSource) -> Boolean)

Requires the sender to match a predicate.