Custom Commands
Updated 16 Mar 2026Define slash commands directly in a .kode file. No plugin.yml, no restart — just /kode reload.
command /kit:
give player cooked_beef 8
give player iron_sword 1
give player torch 16
send "&aStarter kit delivered!" to player
Accessing arguments
When a player types /pay 50, arguments are automatically available:
| Variable | Value |
|---|---|
$args | Full argument string |
$arg1, $arg2, … | Individual space-split arguments |
$argc | Number of arguments supplied |
command /pay:
if $argc == 0:
send "&cUsage: /pay <amount>" to player
return
load $coins from coins_player.name
if $coins < $arg1:
send "&cNot enough coins." to player
return
set $coins = $coins - $arg1
store coins_player.name $coins
send "&aSpent $arg1 coins. Remaining: $coins" to player
Calling other plugin commands
Use execute (as player) or console (as server) to call any installed plugin:
command /hub:
execute "server hub"
command /fly:
execute "fly"
command /reward:
console eco give player.name 500
send "&aYou received &6500 coins&a!" to player
How it works
- The command is intercepted before the server sees it — no clashes with missing server-side registrations.
- It does not appear in tab-complete by default.
- If no script defines the command, it falls through to normal Bukkit dispatch.
- Only one script's block runs per command — the first loaded script wins.