Update the Brigadier guide (#60)
* chore: Update the brigadier command docs and example * fix: Rename brigardier to brigadier * fix: Inline danger block
This commit is contained in:
19
guide/docs/commands/brigadier_example.md
Normal file
19
guide/docs/commands/brigadier_example.md
Normal file
@@ -0,0 +1,19 @@
|
||||
The following command illustrates how to use commands, subcommands, arguments and the command context.
|
||||
|
||||
```kotlin
|
||||
command("gaming") {
|
||||
literal("set") {
|
||||
argument("state", BoolArgumentType.bool()) {
|
||||
suggestList { listOf(true, false) }
|
||||
runs {
|
||||
if (this.getArgument("state"))
|
||||
this.player.sendMessage("yoo gaming has been activated")
|
||||
else {
|
||||
this.player.kill()
|
||||
this.player.sendText("gaming disabled"){ color = KColors.INDIANRED }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user