Wiki 9Minecraft Wiki 9Minecraft

Debugging Rhino Scripts That Fail to Load

Java EditionModGuides 4FAQ 20Related mods 60
DownloadRhino Mod

Get the files on 9Minecraft

Contents (3)
  1. Finding the Error
  2. Common Causes
  3. Isolating the Problem

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.