CommandBuilder

class CommandBuilder(val command: ArgumentBuilder<CommandSourceStack, *>)(source)

If you are using Kotlin, you can use this class to create Brigadier commands Kotlin-style.

You should probably implement your own command system if you are making your own addon, rather than using anything from Pylon Core. We recommend checking out Aikar's commands, as it makes adding commands very easy and simple.

(Blame Kotlin for not allowing us to hide this class in any way from Java).

Constructors

Link copied to clipboard
constructor(command: ArgumentBuilder<CommandSourceStack, *>)

Properties

Link copied to clipboard
val command: ArgumentBuilder<CommandSourceStack, *>
Link copied to clipboard

Functions

Link copied to clipboard
inline fun argument(name: String, type: ArgumentType<*>, block: CommandBuilder.() -> Unit): CommandNode<CommandSourceStack>
Link copied to clipboard
fun build(): CommandNode<CommandSourceStack>
Link copied to clipboard
inline fun executes(crossinline handler: CommandContext<CommandSourceStack>.(CommandSender) -> Unit)
Link copied to clipboard
inline fun executesWithPlayer(crossinline handler: CommandContext<CommandSourceStack>.(Player) -> Unit)
Link copied to clipboard
inline fun literal(name: String, block: CommandBuilder.() -> Unit): CommandNode<CommandSourceStack>
Link copied to clipboard
fun permission(permission: String)
Link copied to clipboard
fun redirect(node: CommandNode<CommandSourceStack>)
Link copied to clipboard
inline fun requires(errorMessage: Component, crossinline predicate: CommandContext<CommandSourceStack>.(CommandSender) -> Boolean)
Link copied to clipboard
fun then(node: CommandNode<CommandSourceStack>)