Wiki 9Minecraft Wiki 9Minecraft
Rhino Wiki › Guides › Debugging Rhino Scripts That Fail to Load

Debugging Rhino Scripts That Fail to Load

Finding the Error

When a Rhino script does not run, the host mod usually prints a stack trace to the game log or console. Open the latest log file and search for your script's filename. The trace tells you the line number and the type of error, which is the fastest way to narrow down the problem.

Common Causes

  • Syntax errors: A missing brace, parenthesis, or semicolon stops the entire file from parsing. JavaScript is unforgiving here.
  • Wrong API names: If you call a function the host mod does not expose, you get an undefined error. Double-check the mod's scripting documentation for the exact spelling.
  • Loading order: Some mods load scripts before their own systems are ready. If your script runs too early, defer your logic using the event hooks the mod provides.
  • File encoding: Save scripts as UTF-8 without a byte order mark. Some loaders choke on other encodings.

Isolating the Problem

Comment out everything except a single log statement, confirm it runs, then uncomment sections one at a time. This binary approach finds the broken line quickly. If the script loads but behaves unexpectedly, add log statements at each step to trace values.