Integrated Scripting Mod Guide: JavaScript Programming for Integrated Dynamics Networks
Integrated Scripting is an addon for Integrated Dynamics that lets you write JavaScript code to handle complex logic operations in your networks. Instead of chaining dozens of Variable Cards for advanced filtering or calculations, you can write concise scripts that get bound to Variable Cards and used anywhere in your network.
Overview
Integrated Scripting is an extension for Integrated Dynamics that introduces JavaScript programming directly into your automation networks. Rather than building enormous chains of Variable Cards and Logic Programmer operations for complex tasks, you write scripts in a built-in code editor and bind their variables and functions to Variable Cards. These scripted cards work everywhere a normal Variable Card does, including Display Panels, Integrated Tunnels exporters, and any other network component.
The mod adds four new items and blocks:
Mendesite (the crafting material), Scripting Disks (script storage), Scripting Drives (network-connected disk readers), and the Scripting Terminal (the in-game IDE where you write and manage scripts). Scripts run on the GraalVM JavaScript engine with strict security settings by default, so performance and safety are built in. You can browse all items and recipes using the tabs at the top of this page.
Prerequisites
Integrated Scripting requires both Cyclops Core and Integrated Dynamics (version 1.21.3 or later) as dependencies. You should already have a working Integrated Dynamics network with cables, a Variable Store, and familiarity with Variable Cards and the Logic Programmer before diving into scripting. You will also need a Drying Basin (or Mechanical Drying Basin) from Integrated Dynamics to create
Mendesite, and access to Menril Resin, which means having Menril Trees growing and a way to harvest their resin.
Basic programming knowledge is recommended. The scripting language is standard JavaScript (ECMAScript), so any prior experience with web development or general programming will transfer directly. The mod's in-game book ("On the Dynamics of Integration") also includes tutorials for beginners.
Getting Started
- 1
Craft Mendesite
Mendesite is the foundational crafting material for all scripting components. Place a piece of Andesite into a Drying Basin and fill it with 1000 mB of Menril Resin. The Drying Basin takes 300 ticks (15 seconds) to produce one Mendesite block, while the Mechanical Drying Basin completes the process in just 15 ticks. You will need several Mendesite blocks, so consider using the mechanical variant for bulk production. - 2
Craft Scripting Disks
Scripting Disks store your script files. Craft them by surrounding a
Mendesite block with four Variable Cards in a plus pattern. This yields 8 Scripting Disks per craft, so one batch goes a long way. Each disk has no storage size limit, but splitting scripts across multiple disks is recommended for organization. - 3
Build a Scripting Drive
The
Scripting Drive is a block that connects to your Integrated Dynamics network and accepts a single
Scripting Disk. Craft it using a Variable Store in the center, three Scripting Disks on the top and sides, and a Jukebox on the bottom. Place the Scripting Drive next to your network cables and insert a Scripting Disk. The disk will receive a unique numerical ID once inserted. - 4
Craft and Place the Scripting Terminal
The Scripting Terminal is a part (like a Display Panel) that attaches to a cable on your network. It requires
Mendesite, Redstone Dust, a Display Panel, and both Variable Transformer types (Input and Output) to craft. Place it on a cable that is connected to your
Scripting Drive. Right-click the terminal to open the built-in code editor. - 5
Write Your First Script
In the Scripting Terminal GUI, select your disk ID from the top-left dropdown, then click the "+" button to create a new script file. Click on the file to open it in the editor. Try writing something simple like: const myVar = 123; Then select the variable name "myVar" with your cursor and insert an empty Variable Card into the slot on the right side. The card is now bound to that value and can be used in Display Panels or anywhere else in your network.
The scripting system has three distinct parts that work together: Scripting Disks store the raw script data, Scripting Drives expose disks to the network, and the Scripting Terminal lets you edit scripts and bind them to Variable Cards. You need all three connected to the same network for the system to function.
Crafting the Components
All crafting in Integrated Scripting starts with
Mendesite. This translucent block is created by combining Andesite with Menril Resin in a Drying Basin. From Mendesite, you craft Scripting Disks and then Scripting Drives. The Scripting Terminal requires additional Integrated Dynamics components. See the Recipes tab for the complete list, but here are the key recipes to get started.
Scripting Components





8Using the Scripting Terminal
The Scripting Terminal opens a simplified IDE when you right-click it. The left side of the screen shows your disk selector (top-left arrows to toggle between disks) and a file list below it. The right side is a text editor with basic syntax highlighting. Scripts save automatically after each modification, so there is no save button to worry about.
To create a new script, click the "+" button at the bottom-left. Click on any script file in the list to open it for editing. The editor supports JavaScript syntax, though it does not detect errors at edit time. Syntax errors will only appear when you try to use a bound Variable Card, so test your scripts by displaying their output in a Display Panel as you develop.
Binding Scripts to Variable Cards
The key workflow is selecting a member name (variable or function) in the editor with your cursor, then inserting an empty Variable Card into the binding slot on the right side of the screen. The Variable Card becomes permanently linked to that script member. It stores the disk ID, script path, and member name internally. You can then use this card in Display Panels, as operator inputs for Integrated Tunnels, or anywhere else Variable Cards are accepted.
A bound Variable Card can be safely moved to any compatible network location, but it will throw errors if the
Scripting Disk it references is not accessible on the current network. Moving a Scripting Disk to a different
Scripting Drive on the same network works fine, but moving it to a completely different network will break existing bindings.
You must select a valid function name or variable name in the editor before inserting a Variable Card. If the selection is invalid, you will see an error message showing your current selection. Double-clicking a variable or function name is the easiest way to select it properly.
Writing Scripts in JavaScript
Scripts use standard ECMAScript (ECMA-262) JavaScript syntax. All the features you would expect are available: variables, functions, arrow functions, loops, arrays, objects, and string templates. Node.js-specific features like require() and fs are not available since scripts run in the GraalVM sandbox, not a Node.js environment.
Constants and Variables
All Integrated Dynamics value types (Integers, Booleans, Strings, Items, Lists, and more) are available in JavaScript and automatically translated back and forth. The simplest way to expose a value is to declare a variable with let or const. Use const for values that never change and let for mutable state. For example, const myBoolean = true; creates a Boolean value, let myInt = 123 + 456; creates an Integer, and const myList = [1, 1, 2, 3, 5]; creates a List. Bind any of these to a Variable Card by selecting the name in the editor.
Functions as Operators
Functions are where Integrated Scripting truly shines. Any JavaScript function can be bound to a Variable Card as an Operator, which can then be used anywhere Integrated Dynamics accepts operators. This is especially powerful for creating custom item filters for Integrated Tunnels exporters and importers. You can define functions using the function keyword or as arrow functions.
For example, a simple item filter function takes an Item argument and returns a Boolean: function filterItem(item) { return item.isStackable() && item.size() >= 16; }. Bind "filterItem" to a Variable Card, and you have a reusable operator that filters for stackable items with a stack size of at least 16. This would take a long chain of Variable Cards and Logic Programmer operations to achieve in vanilla Integrated Dynamics.
Accessing Built-in Operators
The idContext Global
Inside your scripts, the global variable idContext provides access to all Integrated Dynamics operators through its ops field. This lets you call any built-in operator as a function. For example, idContext.ops.itemstackStackable(item) calls the stackable check on an Item, and idContext.ops.itemstackStacksize(item) returns its stack size. To find the exact operator name, check the operator tooltips in the Logic Programmer or the operator list in the "On the Dynamics of Integration" book.
Since idContext.ops calls can get verbose, you can store frequently used operators in local constants: const isStackable = idContext.ops.itemstackIsStackable; and then call isStackable(item) directly. This keeps your scripts readable without losing access to the full operator library.
Object Methods
For even more concise code, value types like Items, Blocks, Fluids, and Entities have methods attached to them automatically. The global function itemstackStackable(item) is also available as item.isStackable() with no arguments. Functions that take two or more arguments shift by one when used as methods. For instance, itemstackStrength(item, block) becomes item.strength(block). You can also access NBT data directly: item.nbt().Damage returns the item's damage value.
A common use case is filtering items from a Chest using an Inventory Reader. Write a function like: function myFilter(item) { return item.isStackable() && item.size() >= 16; } and bind it to a Variable Card. Then use that card as the filter operator in a list Filter operation applied to the Inventory Reader's item list. Display the result in a Display Panel to verify it works.
Advanced Features
Transient Storage (Stateful Scripts)
Integrated Dynamics is built on functional programming principles, which normally means no mutable state. Integrated Scripting partially breaks this rule by letting you declare mutable variables outside of functions using let. These variables persist across function calls, allowing you to track running averages, count invocations, or accumulate sums. For example, you can calculate the average energy consumption over time by keeping a running sum and count.
The catch is that this state is transient. It resets whenever a Variable Card in the network is re-inserted or the server restarts. You cannot rely on these values being permanent. For persistent data storage, use the Delayer from Integrated Dynamics instead.
External Editing
If you have access to the server or singleplayer world files, you can edit scripts with any external text editor or IDE. Script files are stored at world/integratedscripting/ (or saves/[worldname]/integratedscripting/ for singleplayer). Inside this directory, each
Scripting Disk has a folder named by its numerical ID, containing all its script files. Changes saved externally are picked up automatically by the game, and editing through the Scripting Terminal updates external files as well.
Debugging with Logging
When scripts are not behaving as expected, you can use console.log() and console.error() to write debug messages. These write to .stdout and .stderr files alongside your script file. If your script is myfile.js, log output goes to myfile.js.stdout. These log files are accessible through the Scripting Terminal or through external file access. Log files are capped at 2096 lines by default to prevent them from growing too large; server admins can adjust this limit.
Security and Performance
Scripts execute on the GraalVM JavaScript engine with the strictest security settings by default. This means scripts cannot access the file system, network, or any resources outside the Minecraft environment. Server administrators can loosen these restrictions in the configuration if players need file I/O capabilities, but this is disabled by default for good reason. The maximum execution time for scripts is also configurable to prevent performance issues from infinite loops or overly complex operations.
Variables declared with let outside of functions will reset on server restart or when any Variable Card in the network is re-inserted. Do not use transient storage for values that must survive a restart. Use it only for temporary calculations like running averages or counters where losing the data is acceptable.
Practical Use Cases
Integrated Scripting excels at tasks that are awkward or impossible with vanilla Integrated Dynamics logic. Here are some practical applications that demonstrate the mod's strengths.
Calculating statistics like median, standard deviation, or averages across item lists becomes straightforward in JavaScript. Reading all items from a Chest via an Inventory Reader and computing the average stack size is a few lines of code, whereas it would require an enormous web of Variable Cards in pure Integrated Dynamics.
Creating predicate filters for Integrated Tunnels exporters and importers is one of the most common use cases. You can write a single function that checks multiple conditions (is the item stackable, does it belong to a certain mod, does it match a specific tag, is its durability above a threshold) and bind it as a filter operator. Complex multi-condition filters that would require a dozen chained operators in vanilla become a single readable function.
Monitoring and averaging power consumption over time is another powerful application. Using transient storage, you can track energy readings across multiple ticks and calculate a running average to display on a panel. The same technique works for fluid flow rates, item throughput, or any other value you want to smooth out over time.
Script Creation Pipeline
Frequently Asked Questions
Do I need to know JavaScript to use this mod?
Basic programming knowledge is recommended. The mod uses standard JavaScript (ECMAScript), so any prior programming experience helps. However, the in-game book includes tutorials that start from simple constant values and build up to functions, so determined beginners can learn as they go. Simple scripts like const value = 42; require no real programming knowledge at all.
Can I use Node.js features like require() or fs?
No. Scripts run on GraalVM's JavaScript engine, not Node.js. Features like require(), fs, and other Node.js modules are not available. Only standard ECMAScript features are supported. If you have Node.js code that uses these features, you would need to bundle it with a tool like Webpack first to make it compatible.
Why is my Variable Card showing an error after moving it?
A bound Variable Card stores a reference to a specific
Scripting Disk ID, script path, and member name. If the Scripting Disk with that ID is not accessible on the current network (either it was removed or you moved the card to a different network), the card will throw an error. Make sure the disk is inserted in a
Scripting Drive on the same network.
Can I edit scripts outside of Minecraft?
Yes. Script files are stored at world/integratedscripting/ in the world save directory. You can edit them with any text editor while the game is running, and changes sync automatically in both directions. For the best experience, use an IDE like VS Code and load the auto-generated TypeScript typings file (integratedscripting.d.ts) for autocomplete support.
Is there a limit to how complex my scripts can be?
The maximum execution time for scripts is configurable by server administrators to prevent performance issues. Scripting Disks have no storage size limit, but overly complex or infinite-loop scripts will be terminated when they exceed the execution limit. Log files are capped at 2096 lines by default. For practical purposes, any reasonable script will run fine.
Does Integrated Scripting work with Integrated Tunnels?
Absolutely. One of the primary use cases is creating filter functions that you bind to Variable Cards and use as filter operators in Integrated Tunnels exporters and importers. This is far simpler than building complex filter logic with vanilla Variable Cards. Any function that takes an Item and returns a Boolean can serve as an item filter operator.