Skip to content

Issues and Tips

richie3366 edited this page May 1, 2024 · 1 revision

Reloading a script after making changes

Don't restart your game/server! You can reload your changes by executing in order:

  • /kubejs reload startup_scripts
  • /reload
  • If you use a wired modem (which we recommend), just disconnect/reconnect the peripheral modem by right-clicking twice on it. If your peripheral is connected to a computer/turtle without a wired modem, you need to restart them.
  • Enjoy seeing your new changes!

Code/syntax issues may not appear inside the game

Tip

Keep an eye on your Minecraft latest.log logfile, it may be the only place where it displays errors you want to avoid occurring.
KubeJS errors and warnings are also in logs/kubejs

What happens if a block has more than one peripheral?

That happens a lot! We got you covered: our mod will merge them automagically. The peripheral type will consequently be named multiperipheral.

We also took care of generic peripherals provided natively by CC: Tweaked but peripherals provided by other mods may be overridden if a block happens to be matched with one of your custom KJS: CC peripherals. Or the other way around. We will take a look into resolving that in a later version of the mod. Please open GitHub issues whenever you encounter a problematic case.

Beware of naming your methods… methodically. Because methods having the same name on a given block will override randomly over each other.

Peripherals can disconnect randomly when they send updates to neighboring blocks

Make sure your Lua code handles cases when the method returns an error (use pcall to catch them), or when they happen to return nil or false instead of the expected result. If you use Gregtech Modern, make sure to use their latest build (or a version higher than 1.2.0.a), they recently merged a fix resolving an issue causing massive neighbor updates every tick.