errors & diagnostics

compile errors (import/reload time)

when a script fails to compile like during /katton import, you get an exact location and a specific reason:

import failed: compilation failed
  leap_wand:error [leap_wand.kat:7:12] function parameters cannot have types: use function name(a, b)

reading this: script name leap_wand, file leap_wand.kat, line 7, column 12. open your script, go to that exact spot, and fix it.

common compile errors and what they mean:

message what it means
function parameters cannot have types you wrote function f(a: Type), remove the : Type
@Katton.command requires a 'name' argument you forgot name = "..." in the annotation
invalid permission '...' permission must be exactly "admin", "creative", or "all"
duplicate command name '...' within this script you used the same name = "..." on two commands in one script
command name '...' is already used by your script '...' you used the same command name across two different scripts you own
unknown event "..." check spelling against the event list
an annotation must be immediately followed by a function declaration you put something between @Katton.command(...) and the function line
unclosed { somewhere below / unexpected } brace mismatch, count your { and }

runtime errors (while a script is running)

these happen while a script is actually executing, a command run, an event firing, or a scheduled callback. you will get a chat message identifying the script, function, and line:

leap_wand:onLeap() [line 14] division by zero

common runtime errors:

message cause
division by zero you divided or took % of something by 0
undefined variable '...' typo'd a variable name, or used one before declaring it
cannot reassign 'val ...' you tried to reassign something declared with val, use var instead
list index N out of bounds you indexed past the end of a list, check .size() first
missing required argument '...' you called a builtin function without a required parameter