Package-level declarations

Paper integration layer for the core DSL.

This package provides:

Types

Link copied to clipboard
data class KraftlinPaperCommand(val node: LiteralCommandNode<PaperSource>, val description: String?, val aliases: List<String>, val overrideAliases: Boolean)

A built command ready for registration via registerKraftlinCommands.

Link copied to clipboard

ArgumentNode specialized to Paper's CommandSourceStack.

Link copied to clipboard

KContext specialized to Paper's CommandSourceStack.

Link copied to clipboard

ExecuteScope specialized to Paper's CommandSourceStack.

Link copied to clipboard

LiteralNode specialized to Paper's CommandSourceStack.

Link copied to clipboard
object PaperPlatform : PlatformAdapter<PaperSource, CommandSender>

Paper platform adapter for cross-platform command definitions.

Link copied to clipboard
typealias PaperSource = CommandSourceStack

Paper's Brigadier command source type.

Properties

Link copied to clipboard
val PaperContext.sender: CommandSender

The CommandSender who executed the command.

Functions

Link copied to clipboard

Execution handler that extracts the CommandSender 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 CommandSender.

Link copied to clipboard
fun kraftlinCommand(name: String, description: String? = null, aliases: List<String> = emptyList(), overrideAliases: Boolean = false, block: PaperLiteralNode.() -> Unit): KraftlinPaperCommand

Declares a new Kraftlin command for Paper.

Link copied to clipboard
fun Plugin.registerKraftlinCommands(vararg commands: KraftlinPaperCommand)

Registers one or more Kraftlin commands for this plugin.

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 PaperLiteralNode.requiresSender(predicate: (CommandSender) -> Boolean)

Requires the sender to match a predicate.