KubeJS ComputerCraft: Custom Peripherals for Any Block

KubeJS ComputerCraft lets you register custom ComputerCraft peripherals on any block with simple scripts. Download it for Minecraft on Forge and Fabric today.

KubeJS ComputerCraft

If you have ever wanted a ComputerCraft turtle to read the burn time of a furnace, or a computer to flip a block into diamond with a single Lua call, KubeJS ComputerCraft is the add-on you have been waiting for. This mod bridges the scripting power of KubeJS with the peripheral system of ComputerCraft, letting pack authors attach custom peripherals to literally any block in the world. No Java, no recompiling, no wrestling with a full mod development environment. Just a startup script and a little imagination.

What KubeJS ComputerCraft Actually Does

At its core, the add-on exposes a single event, computercraft.peripheral, which fires during startup. Inside that event you call registerPeripheral with a block ID and a peripheral type name, then chain methods onto the result. Each method becomes callable from Lua on any computer or turtle that wraps the target block. The mod handles the plumbing between KubeJS and ComputerCraft's peripheral API, so your script-defined methods behave like native ones.

The add-on supports both Forge and Fabric, which makes it a flexible choice for modpack developers working across loaders. Supported Minecraft versions are listed on the project's Files tab, so check there before you plan a pack around it. Note that the Recent Files view only shows the latest upload, so browse the full Files tab to find the build that matches your game version.

Main Thread vs. Off Thread Methods

The real design decision in KubeJS ComputerCraft is how you declare each method, because the two options trade safety against speed.

mainThreadMethod

Methods registered with mainThreadMethod are scheduled on the main server thread. That means they can safely read and write world data, including tile entity NBT, entity data, and block state. The catch is throughput: the method is limited to roughly one call per tick, so a Lua loop hammering it will queue up and slow down. Use this for anything that touches live world state, like reading a furnace's BurnTime from entity data.

method

Methods registered with plain method have no call limit and run off the main thread, so they are fast and cheap. The trade-off is access: most in-world data is off limits, and touching tile entity NBT from here is a recipe for crashes or corruption. These are ideal for pure logic, cached values, or interactions with your own safe data structures. A common pattern is a method that returns a string or sets a block through a queued action rather than reading it directly.

How to Install KubeJS ComputerCraft

Setup is straightforward for anyone comfortable with a mods folder:

  • Install the matching loader (Forge or Fabric) for your Minecraft version.
  • Add KubeJS, Architectury API if required by your build, and ComputerCraft to the mods folder.
  • Drop the correct KubeJS ComputerCraft jar from the Files tab into the same folder.
  • Launch once to generate the kubejs directory, then place your peripheral script in startup_scripts.
  • Restart the game or run /reload where supported, and test with a computer and a wrapped block.

When you download KubeJS ComputerCraft, always match the jar to both your Minecraft version and your loader. Mixing a Fabric build into a Forge instance is the most common cause of silent failures. If you want to skip the manual file juggling entirely, the foxygame.net launcher bundles KubeJS ComputerCraft for Minecraft in its add-on catalog, so you can add it to a profile and let the launcher handle version matching and updates for you.

Practical Ideas for Pack Authors

Once the basics click, the possibilities expand quickly. Register a peripheral on a custom machine block so players can script their own automation. Expose a "status" method that returns progress percentages for a quest display. Wrap a spawner and let computers toggle it. Because the peripheral attaches to any block ID, even vanilla ones, you can retrofit interactivity onto existing builds without adding new blocks at all.

Keep your scripts organized: one file per peripheral family, clear method names, and comments explaining which methods are main-thread bound. Future you, and anyone else maintaining the pack, will thank you.

Final Thoughts

KubeJS ComputerCraft fills a genuine gap between two of the most powerful modding tools in the ecosystem. It lowers the barrier for custom peripherals from "learn Java and set up a dev environment" to "write a dozen lines of JavaScript," and it does so on both major loaders. Whether you are building a tech-focused pack or just want your computers to talk to more blocks, this add-on deserves a spot in your startup scripts.