⌘K

Error Handling

Updated 16 Mar 2026

Use try / catch / finally to handle runtime errors gracefully.

try:
    give player invalid_item_name 1
catch $err:
    send "&cSomething went wrong: $err" to player
finally:
    send "&7Cleanup complete." to player
  • catch is optional; finally is optional.
  • The catch variable (e.g. $err) holds the error message string.
  • break, continue, and return signals pass through the catch block untouched.