Script Structure
Updated 16 Mar 2026A .kode file can contain any mix of:
| Section | Description |
|---|---|
on <EventName>: | Runs automatically when a Minecraft event fires |
command /name: | Defines a custom in-game slash command |
| Top-level statements | Runs when you call /kode run <scriptname> |
define <name>([params]): | A reusable function definition |
# This is a comment
on PlayerJoin:
send "&aWelcome!" to player
send "&eServer restarted cleanly." to player
define greet($name):
send "&bHello, $name!" to player