CircuitSimCraft
一款 Fabric 模组,将 Minecraft 变成模拟电子实验室。放置电阻、电容、电感和忆阻器作为方块,将它们连接起来,使用电源和函数发生器驱动它们,并用手持示波器探测实时电压/电流——这一切都由一个经过修改的节点分析(MNA)电路求解器提供支持,该求解器属于 SPICE 所使用的算法家族,而非脚本化的近似计算。
这是一个教学工具:目标是让游戏内的行为与实际在实验台上看到的现象完全一致(RC 充电曲线、RL 瞬态响应、忆阻器电阻随累积电荷漂移等),只是时间尺度从现实世界变成了 Minecraft 刻。
截图
示波器同时显示三个通道——函数发生器、电容和电阻,每个通道都有各自颜色编码的轨迹和实时 V/I 读数:
| 方波 |
三角波 |
 |
 |
要求
- Minecraft 26.3 — 请注意这是 Mojang 新的
year.release 版本号,不是旧的 1.21.x 系列。该模组针对此特定版本,因为在构建时它是“最新”的含义。
- Fabric Loader >= 0.19.5
- Fabric API 0.163.0+26.3(必须与 Minecraft 版本匹配)
- Java 25 — 这是一般性的 Minecraft 26.3 要求(它未混淆且需要当前的 JDK),并非该模组特有的要求。
安装
选项 A — 预编译 jar
- 为 Minecraft 26.3 安装 Fabric Loader。
- 从 Modrinth 或 CurseForge 下载适用于 26.3 的 Fabric API jar 文件,并将其放入你的
mods 文件夹中。
- 从此仓库的 Releases 页面获取
circuitsimcraft-<version>.jar,并将其放入同一个 mods 文件夹中。
- 确保你启动的配置使用的是 Java 25 或更高版本(最近支持按 Minecraft 版本自动管理 JVM 的启动器,一旦你选择 26.3,就会自动执行此操作)。
- 使用 Fabric 配置启动游戏。
选项 B — 从源代码构建
git clone https://github.com/rpicos-uib/circuitsimcraft.git
cd circuitsimcraft
./gradlew build
生成的模组 jar 位于 build/libs/circuitsimcraft-<version>.jar。你需要有可用的 JDK 25;要么将其设为默认的 java,要么显式地指向 Gradle:
JAVA_HOME=/path/to/jdk-25 ./gradlew build
有用的开发任务:./gradlew runClient(启动加载了模组的开发客户端)和 ./gradlew runServer(无头专用服务器——方便在不使用 GUI 的情况下检查模组是否加载成功)。
基础组件
对于任何其值为单个数字而非类别的组件(电阻、电容、电感、电压、频率、忆阻器的参数),空手 shift+右键 会打开一个文本输入界面——这与编辑告示牌的操作逻辑相同——预填充当前值及其预设循环已覆盖的最小/最大值范围。普通的空手右键仍然像以前一样在固定预设之间循环;这两种交互方式共存。
这些是 电工 村民的库存商品(见下文)——基本电路所需的日常被动元件、电源和仪器。晶体管、受控源和二极管则位于 高级组件 中,由 电子工程师 出售。
| 方块/物品 |
说明 |
电阻 |
欧姆电阻。空手右键可循环切换 10 / 100 / 1,000 / 10,000 Ω;Shift+右键打开数值编辑器以设置精确阻值。 |
电容 |
理想电容,采用梯形积分模型。循环切换 1 / 10 / 100 / 1,000 µF;Shift+右键打开数值编辑器以设置精确容值。 |
电感 |
理想电感,采用梯形积分模型。循环切换 0.01 / 0.1 / 1 / 5 H(已根据 Minecraft 的刻率进行缩放,而非真实世界元件额定值);Shift+右键打开数值编辑器以设置精确感值。 |
忆阻器 |
电荷控制的线性漂移(HP)忆阻器模型。其阻值会在 $R_{on}$ 和 $R_{off}$ 之间漂移,取决于流经它的累积电荷——即使电路被重建,“记忆”依然保留。空手右键循环切换“开关速度”($q_{max}$)预设,方式同上(默认值:$R_{on}=100,\Omega$,$R_{off}=10{,}000,\Omega$);Shift+右键一次性打开所有三个参数的数值编辑器——$R_{on}$(10–1,000 Ω)、$R_{off}$(1,000–100,000 Ω)以及 $q_{max}$(1e-4–1e-2 C)。 |
电源 |
理想直流电压源。循环切换 1.5 / 5 / 9 / 12 / 24 V;Shift+右键打开数值编辑器以设置精确电压。未激活时处于开路状态,需接收红石信号后才能工作——请先连接电路,然后为其供电。 |
函数发生器 |
时变电压源。空手右键循环切换正弦波/方波/三角波预设(仅改变波形形状——幅度和频率请参阅下方的电压/频率模块,它们由相邻模块中继而来)。Shift+右键打开其专属数值编辑器以设置相位(0–360°,适用于所有三种波形,不仅限于正弦波)——这是唯一一个直接在发生器本身上设置、而非通过模块设置的参数。其红石激活行为与电源相同。未连接任何模块时默认为 5V/1Hz/0°。 |
导线 |
零电阻导体方块。可在六个面上连接。支持探测(见下方探针)——可读取电路中该点的绝对电压,而不仅仅是两个引脚间的压降。 |
接地 |
将其接入的任何网络连接到真实的 0V 参考点,就像真实电路在谈论“某节点电压”之前需要一个接地参考一样。六个面均可导电,像其他组件一样接入即可。探测它始终读数为恰好 0V,确认其实际连接到参考点。 |
电流表 |
串联的 0V 电压源——电气上等同于理想导线,因此不会干扰电路,但能提供精确的电流读数。使用探针固定它,即可在示波器上看到实时电流轨迹,观察方式与电压相同。 |
理想运算放大器 |
无限增益、无限输入阻抗、零输出阻抗——教科书式的理想运放,通过在求解器中引入一个专用的支路电流未知数,在其两个输入端之间强制实现“虚短”(这与用于电压源的 MNA 技巧相同,只是约束所引用的节点与电流注入的节点不同)。这是唯一的三端元件:输出端和反相输入端(V−)分别是前后的引脚,如同往常一样;同相输入端(V+)是方块的顶面(如果方块本身垂直放置,则为北面)。行为固定且理想,没有任何可调参数,因此没有预设循环也没有数值编辑器;交流(波特图)求解器转而使用固定的双极点增益模型(100dB 直流增益,极点位于 20Hz 和 3MHz)——详见交流电源/交流探针。 |
交流电源 |
交流(小信号)扫描的激励源。接线方式与其他两端元件相同,但在常规直流/瞬态仿真中电气上表现为 0V 源(即普通导线)——其真实行为仅通过交流探针显现。所有三个参数(幅度、最低频率、最高频率)只能通过 Shift+右键设置,因为频率范围并不适合用简短的预设列表来表示——此元件没有任何空手右键预设循环。 |
电压模块 |
无方向性的实用立方体(无朝向、无引脚),只要任意面接触函数发生器即可设置其幅度。右键循环切换其自身的预设(1.5/5/9/12/24 V);Shift+右键打开数值编辑器以设置精确电压。同类模块相互接触时,会沿整条链路中继共享同一个值——最近一次被右键点击的模块获胜,并将值传播到链路触及的所有发生器,因此一个控制源可同时驱动多个发生器。 |
|
Frequency Module | 与 Voltage Module 理念相同,但用于设置函数发生器的频率(提供 0.5/1/2/5/10 Hz 预设);Shift+右键点击可打开数值编辑器以设定精确频率。无论排列顺序如何,混合连接的 Voltage 和 Frequency 模块链均可同时传递两者的值。 |
|
Probe | 右键点击组件、导线或接地端,将其固定为示波器 HUD 上同时显示的最多 3 个通道之一(固定第 4 个时会移除最旧的通道);Shift+右键点击取消固定。手持探针时即可查看 HUD ——每个固定通道拥有独立的滚动轨迹,按颜色区分并堆叠在角落。组件显示其两个引脚间的电压降;导线或接地端显示该单点的绝对电压。每个通道的轨迹会自动缩放至其自身历史记录范围,图表顶部和底部以 SI 前缀形式(k/m/u/n/p,取使数值最紧凑的前缀)标注满量程值。当所有 3 个槽位均被占用后,最旧的通道将以黄色边框标出并标记为“(下一个)”,以便你在确认固定新通道前,了解哪个旧通道将被替换。 |
|
X-Y 示波器探头 | 一个独立的第二探头:它不是将通道随时间绘制,而是将一个固定通道的电压对另一个通道的电压进行绘制——这实现了真实台式示波器的 X-Y 模式,用于追踪利萨如图形以进行相位/频率比较。右键点击以固定通道——你刚刚点击的方块始终成为(或保持为)Y 通道,将之前的 Y 通道降级为 X 通道;如果两个槽位都已满,则移除旧的 X 通道;Shift+右键点击取消固定。每个轴独立缩放至其各自通道的峰值幅度,全量程值以 SI 前缀形式(k/m/u/n/p)直接打印在绘图上每个轴的两端,因此两个尺寸差异极大的信号都能充分利用绘图的全范围,而不会因共享刻度导致其中一个被压缩——对于相位差 90°、幅度相等的信号对,由于两者的独立刻度在幅度真正匹配时重合,它们仍能绘制出真正的圆形。此探头的固定功能与常规探头的固定功能相互独立——同时按住两者即可并排查看两个 HUD。 |
|
交流示波器探头 | 与其他两种不同,这是一种真正的两步探头:首先右键点击一个交流电源将其固定为扫描的激励源(会出现提示;此时尚未进行计算)。随后右键点击第二个不同的点——任何组件、导线或接地点——以运行扫描(在电源配置的范围内跨越 60 个对数间隔的频率),并显示伯德图:上方为分贝 (dB) 表示的幅度,下方为度数表示的相位,两者均相对于对数频率绘制。扫描完成后电源仍保持固定状态,因此你可以对其探测更多点而无需每次都重新点击它;Shift+右键点击取消固定。 |
|
R2V Converter | 红石转电压接口:必须直接放置在 Ground 方块上方(既是放置要求,也是其 0V 电气参考点)。读取两个 0-15 的红石信号强度——北 = A,南 = B ——并在其顶面输出 V = A×16 + B(0-255V),像其他任何电源一样接入电路。无值编辑器;输出完全由红石驱动。 |
|
V2R Converter | R2V Converter 的逆操作:同样需直接放置在 Ground 上,读取通过顶部接线输入的任意电压(理想电压表——不汲取电流,不会对其测量对象造成负载),并将其解码回北(A)和南(B)面上的两个 0-15 红石输出,恰好是 V = A×16 + B 的逆运算。 |
|
Breadboard | 并非电路组件——它没有引脚,也不参与求解器计算。它是 Electrician 村民的工作站点方块(见下文):放置一个,让未工作的村民认领它,它就会开始出售此表中的其余物品。 |
接线规则
每个组件占据一个方块,其方向由放置时你所面对的方向决定。它的两个电气引脚分别位于该朝向轴的前面和后面——其余四个面均为绝缘面。导线方块在所有六个面上均可导电。当两个位置各自有一个导电面相对时,它们就会合并为同一个电气节点——因此,组件可以通过导线连接,也可以将两个组件的引脚直接面对面放置(中间无需导线)。
未连接的引脚不会导致崩溃——它被视为浮动节点,因此你可以逐步构建电路,并在每一个中间阶段进行模拟(虽然无用,但安全)。
源在所在区块加载时默认处于关闭状态。 电源、电流源、函数发生器、交流电源和三相电源会在其红石输入发生变化时开启,且这种开/关状态不会被保存。因此,在服务器重启、世界重新加载,或因远离而导致区块卸载后,所有源都会再次关闭,即使其拉杆仍处于开启状态。要重新启动电路,请将拉杆拨到关闭再打开(或以其他方式重新触发其红石输入)。这是有意为之的设计。
R2V/V2R 转换器以及四种受控源(VCVS/VCCS/CCCS/CCVS,见高级组件)是“引脚方向遵循放置时的朝向”这一规则的例外:它们的朝向始终固定(上方 = 有线电气引脚,下方 = 所需的接地连接,南北方向 = 红石 I/O 或控制引脚),无论放置时你面向哪个方向。此外,它们在放置时必须在其正下方有一个**接地(Ground)**方块——如果破坏该接地方块,转换器或受控源也会随之被破坏。
晶体管(NPN/PNP/NMOS/PMOS)和理想运算放大器是三端组件:前面和后面是两个常规引脚,第三个引脚(基极/栅极,或运放器的 V+)位于方块的顶面——如果方块本身垂直放置(朝上或朝下),则第三个引脚位于北面。
变压器是一个四端组件,并且始终直立放置:当你放置它时,它会转向面对你,面对你的那一面显示变压器符号。从正面看,其输入(初级)位于左侧(IN +)和右侧(IN −)面,其输出(次级)位于**顶部(OUT +)和底部(OUT −)**面。每个端子面都在方块本身上有标注。背面不是端子。
高级组件
晶体管、四种经典的依赖/受控源、单相变压器,以及一些完善真实工作台功能的仪表设备——这些由电子工程师村民出售(见下文),而非电工出售,但变压器目前仅可通过合成获得。下面提到的所有“最简模型”参数(β、阈值电压、跨导、增益)均可通过 Shift+右键编辑,使用与基础组件相同值编辑器约定。
此处的所有受控源都依赖于刻意的单 tick 延迟:Circuit.step() 在求解之前会对每个元件进行标记,因此任何在构建自身标记时读取其他节点已求解电压(或其他源已求解电流)的元件,实际上读取的是上一个 tick 收敛的值——这与二极管已使用的“关于上一个 tick 线性化”理念一致。正是这一点使得所有四种受控源、BJT 和 MOSFET 能够在不改变 Circuit 核心求解循环的情况下工作(除了新增一个标记辅助函数 stampTransconductance ——完整说明请参见 MOD_ARCHITECTURE.md)。
| 方块/物品 |
说明 |
二极管 |
放置时你看向的方向的引脚为阳极,相对的引脚为阴极——电流在超过正向压降后易于从阳极流向阴极,而在反向时(几乎)被阻断。右键点击可循环切换硅(约 0.7V)、锗(约 0.3V)或红色 LED(约 2V)预设值——这是一种分类选择,因此没有用于编辑二极管值的 Shift+右键点击编辑器。它通过每刻重新拟合的线性化肖克利二极管方程进行建模,而非查找表。 |
恒流源 |
理想的独立直流电流源——电源的对偶元件。循环切换 0.1 / 0.5 / 1 / 2 A;Shift+右键点击打开精确电流值的编辑器。其红石激活行为与电源相同(未通电时相当于开路,直到通电为止)。 |
电压表 |
串联的理想电压表——输入阻抗无穷大,不汲取电流,不会对正在测量的电路造成负载。它是电流表的电压对偶:使用探针将其固定即可看到实时电压波形,与其他任何组件的操作方式相同。 |
NPN 晶体管 |
集电极是前方(朝向)引脚,发射极是后方引脚,基极是顶面(若垂直放置则为北面)。基极-发射极结复用二极管自身的线性化肖克利模型;集电极电流为 β × 基极电流,并通过 stampTransconductance 作为精确跨导项注入(无延迟)。Shift+右键点击可编辑 β(电流增益),范围 5–500。 |
PNP 晶体管 |
模型和引脚与 NPN 相同,但所有电流方向均相反(底层 Bjt 模型中 polarity = -1)。Shift+右键点击可编辑 β,范围 5–500。 |
NMOS 晶体管 |
漏极是前方引脚,源极是后方引脚,栅极是顶面(若垂直放置则为北面)。采用平方律、仅饱和区模型,每刻围绕前一时刻的漏极电流进行线性化。Shift+右键点击可编辑阈值电压(0.1–5 V)和跨导系数 k(1e-4–0.1 S)。 |
PMOS 晶体管 |
模型和引脚与 NMOS 相同,但漏极电流方向相反。Shift+右键点击可编辑相同的两个参数。 |
VCVS(电压控制电压源) |
必须直接放置在接地方块上,类似于 R2V/V2R 转换器。北面感应控制电压(相对于地);输出(增益 × 控制电压)驱动至顶面。Shift+右键点击可编辑增益,范围 0.1–100。 |
VCCS(电压控制电流源) |
形状与 VCVS 相同,但从其顶面输出电流(跨导 × 控制电压)而非电压——由于这是纯线性关系,它作为精确跨导项注入,无延迟。Shift+右键点击可编辑跨导,范围 1e-4–1 S。 |
CCCS(电流控制电流源) |
四向组件:北面和南面是控制电流感应引脚(内部包含一个类似电流表方块的 0V 电流表),顶面驱动输出电流(电流增益 × 感应电流)以对抗下方所需的接地。Shift+右键点击可编辑电流增益,范围 0.1–100。 |
CCVS(电流控制电压源) |
形状与 CCCS 相同,但输出的是电压(互阻 × 感应电流)而非电流。Shift+右键点击可编辑互阻,范围 1–1,000 Ω。 |
变压器(单相) |
理想变压器,匝数比为 N:M(初级:次级):V_out = (M/N)·V_in 且 I_out = (N/M)·I_in。输入位于左侧 (+) 和右侧 (−) 面,输出位于顶面 (+) 和底面 (−) 面,如从前视角度所见(参见 接线规则)。两侧均表现为阻抗,而非理想源:输出端的负载 Z 从输入端看相当于 (N/M)²·Z,而输出端看到的则是按 (M/N)² 缩放后的输入源阻抗。两个绕组相互隔离,因此输出端无需独立的接地。右键点击可循环切换 1:1 / 1:2 / 2:1 / 1:10 / 10:1;Shift+右键点击可分别编辑 N 和 M,每边 1–1,000 匝。由于其理想特性,它能同时传输直流和交流电(真实变压器仅传输交流电)。探针可读取输出电压和电流;交流探针也能通过它工作。目前尚无村民出售此物品:需自行制作(参见 合成配方)。 |
工作台 |
并非电路组件——它没有引脚,也不参与求解器计算。它是电子工程师村民的工作站点方块(见下文):放置一个,让无业村民认领它,它就会开始售卖本表格中的其他物品。 |
三相组件
一个完整的二次电力“世界”与上方单相世界并存——这里的每个组件都使用一根捆绑导线,一次性承载所有三个相位(A/B/C),而不是通过三根独立的物理连接。专用的捆束线允许你将该捆束布线到任意位置(它会与任何接触的捆束线或捆绑引线合并,行为与单相 Wire 对单个节点的处理方式完全相同);当你需要在两个世界之间交叉时,可以使用 Bundler/Unbundler 配对。由电气工程师村民出售(见下文),而非电工或电子工程师。
| 方块/物品 |
说明 |
三相导线 (3-Phase Wire) |
导线的捆束等效物——可自由向任何方向着色,并与任何接触的三相导线或捆绑引线合并。将相位 A/B/C 作为一个连接共同传输;普通的单相导线与其接触时不会连接(你需要使用 Bundler/Unbundler 才能在两个世界之间交叉)——除了接地 (Ground),它可以直接闭合任一世界的回路(详见下文)。 |
三相电源 (3-Phase Source) |
朝向面是捆绑的三相输出(内部包含三个同频率/振幅、互差 120° 的正弦波源——标准的 A/B/C 相位旋转);背对面是一个普通的中性引线,其接线方式与其他所有电源的“背面”引线连接到 Ground 方块的方式相同。Shift+右键点击可编辑振幅(12–400 V)和频率(0.5–5 Hz)。支持红石门控,类似 Power Supply。 |
三相电流表 (3-Phase Ammeter) |
三个独立的理想电流表串联,每相一个——两根引线均被捆绑,像单相 Ammeter 一样 inline 安装。 |
三相电阻器 (3-Phase Resistor) |
三个普通电阻并联,每相一个,共享一个可编辑的电阻值(10–10,000 Ω)——构成平衡电阻负载/组。 |
三相电感器 (3-Phase Inductor) |
同理,三个电感器共享一个可编辑的电感值(0.01–5 H)。 |
三相电容器 (3-Phase Capacitor) |
同理,三个电容器共享一个可编辑的电容值(1–1,000 µF)。 |
相位捆束器 (Phase Bundler) |
固定且不可旋转的面:捆绑引线始终朝上,相位 A/B/C 分别朝北/东/南。纯拓扑结构——不增加阻抗,就像普通导线本身一样——接收三个独立的单相连接,并将它们直接映射到对应的捆束子节点上。 |
相位解包器 (Phase Unbundler) |
电气特性与捆束器完全相同(相同的固定面,相同的零阻抗映射)——作为一个独立方块存在,纯粹是为了在搭建工作台电路时,“捆束 → 三根导线”和“三根导线 → 捆束”能作为不同的部分被识别。 |
三相示波器探头 (3-Phase Oscilloscope Probe) |
右键点击捆束组件以固定它(Shift+右键取消固定)——最多同时显示 3 个通道,与常规 Probe 相同,但每个通道现在会在同一个图表上叠加所有三个相位,遵循标准的红/黄/蓝相位颜色惯例,而不是每个通道一条轨迹。 |
配电盘 (Switchboard) |
不是电路组件——而是电气工程师村民的工作站方块(见下文)。 |
每个三相部件均由三个对应的单相等效部件构建而成——3× Wire → 1× 三相导线,3× Power Supply → 1× 三相电源,3× Ammeter → 1× 三相电流表,3× Resistor/Inductor/Capacitor → 1× 对应的三相部件,3× Probe → 1× 三相示波器探头——均为无形状合成。Bundler/Unbundler 各需 3× Wire + 1 铁锭,且有形状合成(铁锭位于导线行的正上方 vs. 正下方,彼此镜像)。请参阅下方的 合成配方 表格查看配方图示。
接地 (Ground) 在两个世界中均有效——circuitsimcraft:ground 方块既具有其通常的单相导电性,也具有捆束导电性,因此三相导线可以直接运行到 Ground 结束,无需 Bundler/Unbundler,这与单相导线原本就可以直接闭合回路的方式完全相同。只有当你实际上需要将三个相位拆分到不同的单相目的地(三个独立的仪表、三个独立的负载等)时,才需要 Unbundler——而不仅仅是为了将回路闭合回 0V。
合成配方
所有原料均为原版物品,不依赖任何其他模组。无形状配方以松散的材料集合展示;有形状配方展示实际的 3×3 网格布局。如果某个配方接受两种材料中的任一种填入同一槽位,则会并列显示两个完整的配方变体以得出相同结果,而不是合并为一张图片。
| 配方 |
备注 |
 |
电阻 ×2 — 铁粒、黏土球 或煤炭 作为导电体,铁粒:位于导电体两侧,需塑形。 |
 |
电容器 ×2 — 铁粒、纸张作为历史电容器的电介质,铁粒:位于两侧,需塑形。 |
 |
电感器 ×2 — 铁粒、铜 或铁 锭用于制作线圈,铁粒:位于两侧,需塑形。 |
 |
忆阻器 ×1 — 紫水晶碎片作为切换介质。 |
 |
电源 ×1 — 红石块核心外围环绕 3×3 的铁/铜外壳。 |
 |
函数发生器 ×1 — 3×3 的铁/铜外壳,石英 + 红石火把核心。 |
 |
导线 ×9 — 三个铜锭横向排列,需塑形,廉价/批量制作。 |
 |
接地 ×4 — 铁粒 + 铜锭。 |
 |
电流表 ×2 — 铁粒、铜锭、红石。 |
 |
电压模块 ×1 — 金粒、红石、铁粒。 |
 |
频率模块 ×1 — 紫水晶碎片、红石、铁粒。 |
 |
二极管 ×2 — 铁粒、红石、石英。 |
 |
理想运算放大器 ×1 — 2 个金粒、红石、石英。 |
 |
探针 ×1 — 红石、铁粒和一根木棍,垂直堆叠。 |
 |
X-Y 示波器探针 ×1 — 红石、石英和一根木棍,垂直堆叠。 |
 |
交流电源 ×1 — 红石、萤石粉、金粒(无需塑形)。 |
 |
交流示波器探针 ×1 — 红石、萤石粉和一根木棍,垂直堆叠。 |
 |
R2V 转换器 ×1 — 比较器核心外围环绕 3×3 的铁/铜外壳,比较器是原版读取红石信号强度的装置。 |
 |
V2R 转换器 ×1 — 比较器核心外围环绕 3×3 的铁/金外壳。 |
 |
面包板 ×1 — 橡木木板框架(3×3),内部为红石与铁粒核心。 |
 |
电流源 ×1 — 红石块核心外围环绕 3×3 的金/铜外壳(电源的对偶器件)。 |
 |
电压表 ×2 — 铁粒、金粒、红石。 |
 |
NPN 晶体管 ×2 — 2 个铁粒、石英、红石。 |
 |
PNP 晶体管 ×2 — 2 个铁粒、萤石粉、红石。 |
 |
NMOS 晶体管 ×2 — 2 个铁粒、纸张(栅极绝缘层)、石英。 |
 |
PMOS 晶体管 ×2 — 2 个铁粒、纸张、萤石粉。 |
 |
VCVS(压控电压源) ×1 — 比较器核心外围环绕 3×3 的铜/金外壳。 |
 |
VCCS(压控电流源) ×1 — 比较器核心外围环绕 3×3 的铜/铁外壳。 |
 |
CCCS(流控电流源) ×1 — 比较器核心外围环绕 3×3 的金/铜外壳。 |
 |
CCVS(流控电压源) ×1 — 比较器核心外围环绕 3×3 的金/铁外壳。 |
 |
变压器 ×1 — 两列铜锭(绕组)之间夹着一列铁锭(铁芯),需塑形。 |
|
| 工作台 ×1 — 3×3,以红石和铁粒为核心、外圈环绕平滑石(面包板的专属工作站点图案,采用石材重新设计)。 |
|
| 三相导线 ×1 — 3× 导线(无形状)。 |
|
| 三相电源 ×1 — 3× 电源供应器(无形状)。 |
|
| 三相电流表 ×1 — 3× 电流表(无形状)。 |
|
| 三相电阻器 ×1 — 3× 电阻器(无形状)。 |
|
| 三相电感器 ×1 — 3× 电感器(无形状)。 |
|
| 三相电容器 ×1 — 3× 电容器(无形状)。 |
|
| 相位捆绑器 ×1 — 上方居中放置铁锭,下方为 3 个导线横排,有形状。 |
|
| 相位解绑器 ×1 — 下方居中放置铁锭,上方为 3 个导线横排,有形状 —— 与捆绑器的配方互为镜像。 |
|
| 三相示波器探头 ×1 — 3× 探头(无形状)。 |
目前这些物品都还没有配方书解锁进度,因此不会显示“新配方”的提示——
但它们现在完全可以通过手动制作。如果你想添加这些进度,请参阅 贡献指南。
所有物品也可在 CircuitSimCraft 创意模式库存的独立标签页中找到。
电工村民
放置一块 面包板(按上述方式合成),并让一个无业村民将其认领为工作站点;
它会变成一名 电工,专门 出售 模组自带的组件,并 回收 制作这些组件所需的原材料,全部以绿宝石交易,而非原版交易。它拥有独特的外观,并非默认的缺失纹理占位符:身穿石板/钢铁工具围裙,配有警示黄色徽章点缀,与任何原版职业服装均不相同。如同所有原版职业一样,它在成功交易后会升级(新手 → 大师),从而解锁后续等级。每个等级最多提供 两种可出售组件和两种可购买原材料(绝不会更多,且始终两者兼有),因此单个村民的交易界面永远不会堆满内容 —— 除了大师级,这是一个有意为之的特例(见下文):
| 等级 |
出售 |
收购 |
| 1 — 新手 |
电阻、电容 |
铁粒、粘土球 |
| 2 — 学徒 |
电源、函数发生器 |
铁锭、铜锭 |
| 3 — 熟练工 |
交流电源 |
金粒、荧光石粉 |
| 4 — 专家 |
探针、交流示波器探针 |
红石、木棍 |
| 5 — 大师 |
忆阻器 / R2V 转换器 / V2R 转换器中的任意两种 |
紫水晶碎片、红石(通常两者都有) |
收购类交易每次交易收取 8 个原材料(对于最稀有的紫水晶碎片则是 4 个——这是一批无需刷怪即可实际收集的物资);出售类交易保持每种组件原有的单次交易数量(每次 1-2 个,与之前未变)。每笔交易——无论是收购还是出售——现在都可以在该村民补货前进行 15 次(max_uses: 15,这是一个固定数值,取代了之前按等级划分的 4-12 值)。同一等级的收购价格低于出售价格,正如现实商店的利润空间:原材料的价值低于由其制成的成品组件。
并非所有可制作的物品都能以此方式出售——导线、接地端、电感、电压模块、频率模块以及 X-Y 示波器探针已被移除,以符合每级两项的限制(这六项仍保留在合成表中,是简单廉价的合成配方,不受影响)。二极管并未被移除,只是调整了位置——它由 电子工程师 出售(见下文),而非电工。交易完全由数据驱动(位于 data/circuitsimcraft/{villager_trade,tags/villager_trade,trade_set}/electrician/),而非硬编码在 Java 中——此 Minecraft 版本的 VillagerProfession 仅指向每个等级的 TradeSet 资源键,因此重新平衡价格或添加交易只需编辑 JSON,无需重新编译。每个等级的 trade_set 中的 amount 设置为其交易池的大小,因此列出的每项交易都会一起提供,而不是随机子集(不同于原版职业,它们通常从更大的池中抽取少量)——这是确保上述“同时出售和收购的物品始终存在”承诺的唯一方式。
大师级是那个有意的特例。 应用户要求,大师级的出售池包含三项物品(忆阻器、R2V 转换器、V2R 转换器),而不是两项,且每位特定的电工会随机提供这三项中的两项——这是为了这一特定等级而有意重新引入的原版风格随机性。Minecraft 的交易系统只能在每个等级内对 一个 合并池进行随机化,无法在保持一个子集(两项收购交易)确定的同时,对同一等级内的另一个子集(三项出售交易)进行随机化——因此大师级的完整池包含 5 个条目(3 项出售 + 2 项收购),且 amount: 4,意味着恰好有一个条目会被随机排除。大多数情况下,被排除的是三项出售物品之一(从而实现预期的“三项中任选两项”),但偶尔也会排除两项收购物品之一——大师级是唯一一个“两项收购物品始终存在”的保证不绝对成立的等级。
电工工坊
模组附带了一个现成的商店,以数据包函数的形式提供——无需手动建造。站在你想放置的位置(任何地形均可:它会清除自身的占地范围并先浇筑自己的地基,因此不平整的地面、斜坡或未生成的区块都没问题),然后运行:
/function circuitsimcraft:electrician_shop
这会建造一座小型橡木与铜制工坊,带有 slab 屋顶和一个避雷针顶饰(最直白的“电工”象征符号),内部后墙旁已放置好一块面包板和一个小货架(存放导线、一个电阻、一个电容)——准备好迎接村民进来接手工作:
该函数的源码(data/circuitsimcraft/function/electrician_shop.mcfunction)是普通的 /fill//setblock 命令,如果你想更换皮肤可以参考——参见 MOD_ARCHITECTURE.md 了解其构建和验证过程。
电子工程师村民
放置一块 工作台(按上述方式合成),并让一个无业村民将其认领为工作站点;
它会变成一名 电子工程师,专门出售/收购上文 高级组件 表中的物品,处理方式与电工处理基础组件相同。它也有自己独特的外观——基于电工纹理的白色实验服重着色,将徽章点缀从警示黄改为二极管红光,以确保这两种职业在视觉上不会混淆。同样遵循升级机制(新手 → 大师),同样遵守“每级最多出售和收购各两项,绝不多于两项”的规则,大师级再次成为有意的特例:
| 等级 |
出售 |
收购 |
| 1 — 新手 |
二极管, 电压表 |
石英, 纸张 |
| 2 — 学徒 |
电流源, NPN 晶体管 |
铁粒 |
| 3 — 熟练工 |
PNP 晶体管, NMOS 晶体管 |
萤石粉 |
| 4 — 专家 |
PMOS 晶体管, VCVS(压控电压源) |
金锭 |
| 5 — 大师 |
VCCS / CCCS / CCVS 中的任意两种 |
红石块(通常有货) |
与电工的贸易条款相同:每笔收购交易收集 8 个原材料
每笔交易(大师级最昂贵的红石块为 4 块),每次交易在重新补货前允许使用 15 次
出售价格随等级提升而增加(新手为 2 绿宝石,大师为 8 绿宝石,
匹配电工自身针对受控源的 R2V/V2R 等级定价)。大师级的出售池包含三项物品,但一次仅提供两项 —— 这与电工大师级使用的“随机排除”技巧相同,只是这里的完整池包含 4 个条目(3 项出售 + 1 项收购),且 amount: 3,因此偶尔被排除的条目是收购交易而非出售物品,而不仅仅是“三项中的任何两项”。
电子工程师工作室
理念与电工工作室相同,故意采用不同的配色方案,使这两个职业的建筑一眼就能区分开来 —— 这是一个由石砖和磨制安山岩构成的“实验室”,配有铁栏杆和石英尖顶,而不是电工的橡木铜饰小屋:
/function circuitsimcraft:engineer_workshop
这会在后墙放置一个工作台,旁边有一个小库存架(放着一个二极管和一个 NPN
晶体管),正如电工商店放置一块面包板和初始库存一样。该函数的源码位于
data/circuitsimcraft/function/engineer_workshop.mcfunction —— 普通的 /fill//setblock 命令,
与电工的一样。
电气工程师村民
放置一个 配电盘(制作方式与工作台面和面包板相同 —— 见
合成配方),让一个失业的村民将其认领为工作站点;它将成为一名 电气工程师,并出售/收购上面列出的 三相组件 表格 —— 这是第三个职业, alongside 电工(基础单相组件)和电子工程师(高级单相组件),这次面向捆绑的三相世界。升级路线相同(新手 → 大师),与其他两者的定价/补货惯例相同:
| 等级 |
出售 |
收购 |
| 1 — 新手 |
三相导线, 三相电流表 |
铜锭 ×8 |
| 2 — 学徒 |
三相电源, 三相探针 |
铁粒 ×12 |
| 3 — 熟练工 |
相位打包器, 相位解包器 |
萤石粉 ×4 |
| 4 — 专家 |
三相电阻器, 三相电感器 |
金锭 ×4 |
| 5 — 大师 |
三相电容器 |
红石块 ×1 |
与其他两个村民相同的贸易条款:每次交易在重新补货前允许使用 15 次,
出售价格随等级提升而增加 —— 新手每笔 2 绿宝石,专家/
大师级最昂贵的束图部件(打包器/解包器为 8,电感器/电容器为 9)最高达 8–9 绿宝石。
电气工程师工作室
与其他两个工作室的理念相同,拥有自己独特的配色方案,以便所有三个职业的建筑一眼就能区分开来 —— 这是一个由深板砖和铜构成的“变电站”,带有避雷针尖顶,而不是电工的橡木小屋或电子工程师的石质实验室:
/function circuitsimcraft:electrical_engineer_workshop
这会在后墙放置一个配电盘,准备好让村民走进来接手这份工作。该函数的源码位于
data/circuitsimcraft/function/electrical_engineer_workshop.mcfunction —— 普通的
/fill//setblock 命令,与其他两个一样。
示例电路
八个现成的电路,每个对应一个数据包函数,采用与前三个工作室相同的基于 /fill//setblock 的方法 —— 无需手动布线即可开始。站在你希望工作台西南角的位置,然后运行其中一个:
/function circuitsimcraft:voltage_divider # 实验 1:基本分压器
/function circuitsimcraft:rc_lowpass # 实验 2:RC 低通波特图
/function circuitsimcraft:rlc_resonance # 实验 3:RLC 谐振波特图
/function circuitsimcraft:half_wave_rectifier # 实验 4:半波整流器
/function circuitsimcraft:memristor_hysteresis # 实验 5:忆阻器受控磁滞回线
/function circuitsimcraft:opamp_bode # 实验 6:运算放大器开环波特图
/function circuitsimcraft:three_phase_load # 实验 7:平衡三相电阻负载
/function circuitsimcraft:three_phase_bundle_unbundle # 实验 8:打包/解包往返行程
每个模组都会开辟自己的空间、铺设基础,并在每个组件的默认预设上连接电路(本模组中的组件不会在保存/重新加载之间保留右键选择的预设,因此新放置的组件始终从其默认值开始,无论实验要求如何),在源上方放置一个未翻转的杠杆,并提供适合该工作的示波器探头。函数自身的头部注释说明了达到每个实验预期组件值和预期结果所需的精确右键操作次数。前六个实验在模组的配套论文 latex_mod/sections/07_results_experiments.tex 中有完整描述(包括推导过程、预测数值以及每个实验背后的物理原理),这里以可构建的结构形式重现,而不是仅作为图表呈现——实验 7 和 8(三相工作台)晚于该报告的撰写时间,尚未包含在论文中。实验 8 也是模组中捆绑器/解绑器对的参考构建:一个三相源连接到一个解绑器,三个独立的单相接电阻器(每相一个),一个将它们重新组合的捆绑器,一个三相电阻器,然后直接接地——在一个工作台中展示了捆绑/单相接交叉的两个方向,并证明接地可以直接闭合捆绑运行而无需第二个解绑器。它们的源文件位于 data/circuitsimcraft/function/,与模组中的其他函数一样,均为纯文本格式。
架构说明,供任何扩展此模组的人参考
src/main/java/com/rpicos/circuitsimcraft/
sim/ 纯 Java 电路求解器 — 零 Minecraft 依赖,可独立进行单元测试
block/ 方块类(放置、朝向、右键交互)
blockentity/ 方块实体类(实际的模拟状态 + 每个组件的电路布线)
network/ 世界侧导线连通性图 + 客户端<->服务器探头协议
item/ 探头物品
src/client/java/com/rpicos/circuitsimcraft/client/ HUD 渲染、客户端网络通信
求解器 (sim 包)
Circuit 是一个通用的改进节点分析引擎:节点 0 始终是地,其他每个节点都是你用 addNode() 分配的整数。Element 的实现类(Resistor、Capacitor、Inductor、Memristor、CurrentSource、Vccs、Bjt、Mosfet)每一步都会将自己印入电导矩阵;VoltageSource 获得其自己的支路电流未知数,这是理想源的标准 MNA 处理方式 —— Vcvs 和 Ccvs 都是简单的工厂方法,只负责构建一个。IdealTransformer 也获得一个支路电流未知数,其一次侧/二次侧电压比约束被印入该行;其系数是实数,因此同一元素无需更改即可用于交流求解器。
有源元件使用梯形积分伴随模型(与 SPICE 使用的技术相同),而非后向欧拉法,因此 LC 型行为不会被人为阻尼掉;BJT 和 MOSFET 模型复用了相同的“关于上一刻线性化”精神(BJT 的基极-发射极结直接复用了二极管的 DiodeMath 辅助类)。所有受控/有源元件相对于无源互阻电阻的定义不对称性都被捕获在一个共享的印入辅助函数 stampTransconductance 中 —— 有关让所有四种受控源和两种晶体管家族在不触碰此求解循环的情况下工作的单tick延迟推理,请参见上面的 高级组件。
另一个复数求解器 AcCircuit 与之并存,用于交流(伯德图)分析:Complex 是一个普通的不可变复数,AcElement 实现类给定角频率时直接印入频率相关的导纳(不涉及时间步长),AcVoltageSource/AcOpAmp 处理源和运算放大器的双极点增益模型的方式与其瞬态对应物相同,即“拥有自己的支路电流未知数”。CircuitNetworkManager 计算一次布线拓扑,并为两个求解器重用相同的节点编号,因此它们绝不会在哪个位置对应哪个节点上产生分歧。
由于这个包完全没有导入 Minecraft 的任何内容,你可以直接使用 javac/java 编写并运行针对它的纯 Java 测试 —— 无需 Gradle,无需反编译 Minecraft,迭代速度快。这正是求解器在开发期间得到验证的方式:针对闭式 RC/RL 阶跃响应、忆阻器的解析电荷控制 ODE,以及对于交流求解器而言,针对闭式伯德图参考(电阻分压器的平坦响应、RC/RL 分压器的 -3dB/45° 截止点和 20dB/十倍频程滚降,以及运算放大器模型的直流增益和极点频率)。
添加新组件类型
- 如果是新型元件,请在
sim/ 中添加物理逻辑(如果仅仅是现有元件的不同预设,则跳过此步骤)。
- 创建一个继承自
ComponentBlockEntity 的 blockentity/YourComponentBlockEntity.java,实现 addToCircuit、probeCurrent、probeSummary 和 cyclePreset。
- 创建一个继承自
ComponentBlock 的 block/YourComponentBlock.java(复制现有的例如 ResistorBlock.java —— 它是一个约 25 行的模板)。
- 在
ModBlocks、ModBlockEntities、ModItems 中注册它,并将其添加到 ModCreativeTab。
- 添加纹理(
textures/block/your_component.png,16×16 —— 前后会自动获取共享的 terminal.png 引线纹理,因此你只需为其余四个面提供主体纹理)、一个 blockstates/your_component.json 和一个 models/block/your_component.json(复制现有的配对 —— 除了纹理路径外它们是通用的),以及一个语言条目。
- 可选地添加一个
data/circuitsimcraft/recipe/your_component.json。
如果你的组件拥有 3 个或更多端子,请直接继承 NetworkBlockEntity 而不是 ComponentBlockEntity(参见 OpAmpBlockEntity、NpnBlockEntity 或 Vcvs/Vccs/Cccs/Ccvs 系列作为先例),并在 CircuitNetworkManager.rebuild() 中添加你自己的分发分支。如果该组件应始终放置在具有固定朝向的 Ground 方块上(例如 R2V/V2R 转换器和四个受控源),请继承 GroundedComponentBlock 而非直接继承 ComponentBlock。请参阅 COMPONENT_ADD.md 和 MOD_ARCHITECTURE.md 获取完整指南,包括如果你的组件应由新职业出售而非现有职业出售时使用的“第二个村民职业”模式。
已知限制
- 电路重建时组件状态会重置。
CircuitNetworkManager 会在网络中任何地方的接线发生变化时从头重建整个 Circuit,因此电容器的电荷或电感的电流在此时会重置为零。忆阻器是例外——其状态分数在重建时被明确保留,因为持久化状态正是忆阻器的核心意义所在。让其他组件也保持持久化是一个很好的入门贡献。
- 没有配方书解锁进度 —— 配方可以工作,但在首次可用时不会以高亮显示或弹出提示的形式出现。
- 交流分析仅适用于小信号,且目前完全不涵盖高级组件(变压器除外)和三相组件。 在进行扫描时,除了固定的交流电源外,所有独立源均被强制标记为 0V,无论其自身的红石激活状态如何;运算放大器的双极增益(100dB 直流增益,极点位于 20Hz/3MHz)是一个固定常量,尚未通过值编辑器暴露;而忆阻器的交流情况仅仅是一个冻结的电阻,尚未建模其自身的频率依赖性。晶体管、四个受控源以及每个三相组件根本没有实现
AcStampable,因此在博德图扫描期间它们表现为开路,这是出于省略而非任何有意设计的小信号模型——这是一个真正的后续贡献,而非设计选择。
- 垂直放置的晶体管上的基极/栅极徽章纹理未经验证。 Java 电气模型无论如何都是方向正确的(根据上述接线规则,当朝上/下放置时,基极/栅极始终是方块的北面)——未测试的仅仅是当方块本身侧放时,绘制在该确切北面上的纹理对玩家来说是否正确可读。已确认所有四种水平方向正确;尚未视觉检查朝上/下的情况。
- 三相示波器的实际屏幕渲染,以及电气工程师的交易报价,尚未在真实的连接客户端中进行视觉确认 —— 两者都仅通过服务器端无头测试进行了验证(通过日志检查真实求解的电路值),而不是通过查看渲染后的游戏画面来确认。
贡献
欢迎提交 Issues 和 PR。如果你正在添加一个组件,请附上你所使用的物理模型的说明(提供方程链接即可)—— 这个模组的目标是让游戏中的行为实际上是正确的,而不仅仅是看起来合理。
翻译
支持 英语、西班牙语 (es_es)、加泰罗尼亚语 (ca_es)、德语 (de_de)、
法语 (fr_fr)、巴西葡萄牙语 (pt_br)、简体中文 (zh_cn)、
日语 (ja_jp)、韩语 (ko_kr)、印地语 (hi_in)、希腊语 (el_gr) 和 俄语 (ru_ru; 目前仅有方块和物品名称,其余内容显示为
英语) —— Minecraft 会自动匹配与你的游戏语言相符的版本。所有玩家可见的字符串均可翻译:
方块/物品名称、探针读数、聊天消息、示波器 HUD 和值编辑器。
要添加一种语言,你只需要一个文件:
- 复制
en_us.json 并将其命名为对应 Minecraft 语言的代码(例如俄语为 ru_ru.json,法语为 fr_fr.json)。
- 仅翻译值(右侧部分)。保持每个键完全不变。
- 保留每个
%s 占位符 —— 每个占位符在运行时都会按顺序填充为一个数字或名称,与英语中的顺序相同。如需字面意义上的百分号,请写入 %%。如需重新排列占位符,请使用编号占位符:%2$s ... %1$s。
- 单位是文本的一部分,因此如果你的语言需要本地化单位,请进行本地化处理(例如
ohm -> Ом)。值编辑器的单位使用可选的 unit.circuitsimcraft.* 键;任何没有此类键的单位将回退到其符号。
- 打开一个 Pull Request 将该文件添加到
src/main/resources/assets/circuitsimcraft/lang/,或者直接将该文件发送给维护者。任何你遗漏的键都将回退到英语,因此部分翻译仍然有效。
感谢我们的翻译者:俄语翻译由 CurseForge 用户
user_whgfaemh28tr34xm 贡献。
引用
如果你在任何地方使用了 CircuitSimCraft —— 在课堂上、论文中、演示中、衍生模组中等等 —— 请注明作者:Rodrigo Picos, Stavros G. Stavrinides, George Stavrinides, Ariadna Picos,
和 Gerard Picos。对于非正式用途,链接回此仓库即可;对于学术工作,请按以下方式引用:
Rodrigo Picos, Stavros G. Stavrinides, George Stavrinides, Ariadna Picos, and Gerard Picos.
CircuitSimCraft: a Fabric mod for teaching analog electronics in Minecraft.
https://github.com/rpicos-uib/circuitsimcraft, 2026.
BibTeX:
@software{picos_mine_memristors,
author = {Picos, Rodrigo and Stavrinides, Stavros G. and Stavrinides, George and Picos, Ariadna and Picos, Gerard},
title = {CircuitSimCraft: a Fabric mod for teaching analog electronics in Minecraft},
url = {https://github.com/rpicos-uib/circuitsimcraft},
year = {2026}
}
另请参阅 CITATION.cff,GitHub 会自动读取该文件以支持其“引用此仓库”按钮。
许可证
CC BY 4.0 — 详见 LICENSE。与宽松的软件许可证(如 MIT、Apache 等)不同,CC BY 将署名作为重复使用的法律条件,而不仅仅是礼貌要求——上述引用完全满足学术用途的署名要求;对于非正式用途,链接回本仓库即可。
CircuitSimCraft
A Fabric mod that turns Minecraft into an analog electronics lab. Place resistors, capacitors,
inductors and memristors as blocks, wire them up, drive them with power supplies and function
generators, and probe the live voltage/current with a handheld oscilloscope — all backed by a
real modified-nodal-analysis (MNA) circuit solver, the same family of algorithm SPICE uses, not a
scripted approximation.
This is a teaching tool: the goal is for the in-game behavior to actually match what you'd see on
a real bench (RC charge curves, RL transients, a memristor's resistance drifting with accumulated
charge), just at Minecraft-tick timescales instead of real-world ones.
Screenshots
The oscilloscope pinning three channels at once — a Function Generator, a Capacitor, and a
Resistor, each with their own color-coded trace and live V/I readout:
| Square wave |
Triangle wave |
 |
 |
Requirements
- Minecraft 26.3 — note this is Mojang's new
year.release versioning, not the old 1.21.x
line. The mod targets this specific version because it's what "latest" means as of build time.
- Fabric Loader >= 0.19.5
- Fabric API 0.163.0+26.3 (must match the Minecraft version)
- Java 25 — this is a Minecraft 26.3 requirement in general (it ships unobfuscated and needs a
current JDK), not something specific to this mod.
Installation
Option A — prebuilt jar
- Install Fabric Loader for Minecraft 26.3.
- Download the Fabric API jar for 26.3 from Modrinth or
CurseForge and drop it in your
mods folder.
- Grab
circuitsimcraft-<version>.jar from this repo's Releases page and drop
it in the same mods folder.
- Make sure the profile you launch with is on Java 25+ (recent launchers that auto-manage a JVM
per Minecraft version will already do this once you select 26.3).
- Launch with the Fabric profile.
Option B — build from source
git clone https://github.com/rpicos-uib/circuitsimcraft.git
cd circuitsimcraft
./gradlew build
The mod jar comes out at build/libs/circuitsimcraft-<version>.jar. You need a JDK 25 available;
either make it your default java, or point Gradle at it explicitly:
JAVA_HOME=/path/to/jdk-25 ./gradlew build
Useful dev tasks: ./gradlew runClient (launches a dev client with the mod loaded) and
./gradlew runServer (headless dedicated server — handy for checking the mod loads without a GUI).
Basic Components
For any component whose value is a single number rather than a category (resistance,
capacitance, inductance, voltage, frequency, the memristor's parameters), an empty-hand
shift+right-click opens a text-entry screen — the same interaction spirit as editing a
sign — pre-filled with the current value(s) and the same min/max range its preset cycle
already covers. A plain empty-hand right-click still cycles through the fixed presets exactly
as before; the two interactions coexist.
These are the Electrician villager's stock-in-trade (see below) — the everyday passive
components, sources, and instrumentation you need for a basic circuit. Transistors, controlled
sources, and the diode live in Advanced Components instead, sold by the
Electronics Engineer.
| Block/Item |
What it is |
Resistor |
Ohmic resistor. Right-click (empty hand) to cycle 10 / 100 / 1,000 / 10,000 Ω; shift+right-click opens the value editor for an exact resistance. |
Capacitor |
Ideal capacitor, trapezoidal-integration model. Cycles 1 / 10 / 100 / 1,000 µF; shift+right-click opens the value editor for an exact capacitance. |
Inductor |
Ideal inductor, trapezoidal-integration model. Cycles 0.01 / 0.1 / 1 / 5 H (scaled for Minecraft's tick rate, not real-world component ratings); shift+right-click opens the value editor for an exact inductance. |
Memristor |
Charge-controlled linear-drift (HP) memristor model. Resistance drifts between $R_{on}$ and $R_{off}$ based on accumulated charge through it — the "memory" persists even when the circuit is rebuilt. Empty-hand right-click cycles a "switching speed" ($q_{max}$) preset as before (defaults: $R_{on}=100,\Omega$, $R_{off}=10{,}000,\Omega$); shift+right-click opens the value editor for all three parameters at once — $R_{on}$ (10–1,000 Ω), $R_{off}$ (1,000–100,000 Ω), and $q_{max}$ (1e-4–1e-2 C). |
Power Supply |
Ideal DC voltage source. Cycles 1.5 / 5 / 9 / 12 / 24 V; shift+right-click opens the value editor for an exact voltage. Inactive (open-circuit) until it receives a redstone signal - wire up the circuit first, then power it on. |
Function Generator |
Time-varying voltage source. Empty-hand right-click cycles sine/square/triangle presets (waveform shape only - see Voltage/Frequency Module below for amplitude and frequency, both relayed in from a neighboring module). Shift+right-click opens its own value editor for Phase (0–360°, applies to all three waveform shapes, not just sine) - the one parameter set directly on the generator itself rather than through a module. Same redstone-activation behavior as the Power Supply. Defaults to 5V/1Hz/0° with no modules attached. |
Wire |
Zero-resistance conductor block. Connects on all six faces. Probeable in its own right (see Probe below) - gives the absolute voltage at that point in the circuit, not just a drop across two leads. |
Ground |
Ties whatever network it's wired into to a real 0V reference point, the same way a real circuit needs a ground reference before "voltage at this node" means anything. Conductive on all six faces, wire it in like any other participant. Probing it always reads exactly 0V, confirming what's actually tied to reference. |
Ammeter |
A 0V voltage source in series - electrically an ideal wire, so it doesn't disturb the circuit, but gives an exact current reading. Pin it with the Probe to see a live current trace on the oscilloscope, the same way you'd watch a voltage. |
Ideal Op-Amp |
Infinite gain, infinite input impedance, zero output impedance - the textbook ideal op-amp, enforcing a "virtual short" between its two inputs via its own dedicated branch-current unknown in the solver (the same MNA trick used for voltage sources, just referencing different nodes for the constraint than for the current injection). The only 3-terminal component: output and the inverting input (V−) are the front/back leads as usual; the non-inverting input (V+) is the block's top face (or its north face, if the block itself is oriented vertically). Fixed, ideal behavior with no adjustable parameter at all, so there's no preset cycle and no value editor; the AC (Bode-plot) solver instead uses a fixed two-pole gain model (100dB DC gain, poles at 20Hz and 3MHz) - see AC Source/AC Probe below. |
AC Source |
The excitation for an AC (small-signal) sweep. Wired like any other two-terminal component, but electrically a 0V source (a plain wire) in the regular DC/transient simulation - its real behavior only appears through the AC Probe. All three parameters (amplitude, min frequency, max frequency) are set through shift+right-click only, since a frequency range isn't the kind of thing a short preset list represents well - there's no plain-right-click preset cycle at all for this one. |
Voltage Module |
Undirected utility cube (no facing, no leads) that touches a Function Generator on any face and sets its amplitude. Right-click cycles its own preset (1.5/5/9/12/24 V); shift+right-click opens the value editor for an exact voltage. Same-kind modules touching each other relay one shared value along the whole chain - whichever module was right-clicked most recently wins and propagates to every generator the chain reaches, so one control can drive several generators at once. |
Frequency Module |
Same idea as the Voltage Module, but sets a Function Generator's frequency (0.5/1/2/5/10 Hz presets); shift+right-click opens the value editor for an exact frequency. A mixed chain of Voltage and Frequency modules relays both values through, regardless of which order they're arranged in. |
Probe |
Right-click a component, Wire, or Ground to pin it as one of up to 3 channels shown simultaneously on the oscilloscope HUD (pinning a 4th evicts the oldest); shift+right-click unpins it. Hold the probe in either hand to see the HUD - each pinned channel gets its own scrolling trace, color-coded, stacked in the corner. A component shows the voltage drop across its two leads; a Wire or Ground shows the absolute voltage at that single point. Each channel's trace is auto-scaled to its own history, with the full-scale value printed at the top and bottom of its graph in SI-prefixed form (k/m/u/n/p, whichever keeps the number compact). Once all 3 slots are full, the oldest channel is outlined in yellow and labeled "(next)" so you can see which one a new pin would evict before you commit to it. |
X-Y Oscilloscope Probe |
A second, independent probe: instead of plotting channels against time, it plots one pinned channel's voltage against another's - a real bench oscilloscope's X-Y mode, tracing Lissajous figures for phase/frequency comparisons. Right-click to pin - whichever block you just clicked always becomes (or stays) the Y channel, demoting the previous Y to X and evicting the old X if both slots were already full; shift+right-click unpins. Each axis is scaled independently to its own channel's peak magnitude, with the full-scale value printed at both ends of each axis directly on the plot in SI-prefixed form (k/m/u/n/p), so two very differently sized signals both use the plot's full range instead of one being squashed by a shared scale - a 90°-phase-shifted, equal-amplitude pair still traces an actual circle, since the two independent scales coincide whenever the amplitudes actually match. Independent of the regular Probe's own pins - hold both at once to see both HUDs side by side. |
AC Oscilloscope Probe |
A genuine two-step probe, unlike the other two: right-click an AC Source first to pin it as the sweep's excitation (a hint appears; nothing is computed yet). Right-click a second, different point afterward - any component, wire, or ground - to run the sweep (60 log-spaced frequencies across the source's configured range) and show a Bode plot: magnitude in dB on top, phase in degrees below, both against log-frequency. The source stays pinned afterward, so you can probe more points against it without re-clicking it each time; shift+right-click unpins. |
R2V Converter |
Redstone-to-voltage interface: must be placed directly on top of a Ground block (both a placement requirement and its 0V electrical reference). Reads two 0-15 redstone signal strengths - North = A, South = B - and outputs V = A×16 + B (0-255V) on its top face, wired into the rest of the circuit like any other source. No value editor; the output is entirely redstone-driven. |
V2R Converter |
The inverse of the R2V Converter: also placed directly on Ground, reads whatever voltage is wired into its top face (an ideal voltmeter - draws no current, never loads down what it's measuring), and decodes it back into two 0-15 redstone outputs on its North (A) and South (B) faces, the exact inverse of V = A×16 + B. |
Breadboard |
Not a circuit component - it has no leads and takes no part in the solver. It's the Electrician villager's job site block (see below): place one, let an unemployed villager claim it, and it starts selling the rest of this table. |
Wiring rules
Every component occupies one block, oriented by the direction you were looking when you placed
it. Its two electrical leads are its front and back faces (along that facing axis) — the other
four faces are insulated. Wire blocks conduct on all six faces. Two positions merge into the same
electrical node whenever each one presents a conductive face toward the other — so components
"connect" either through wire, or by placing two components lead-to-lead directly against each
other, no wire needed in between.
An unconnected lead doesn't crash anything — it's treated as a floating node, so you can build a
circuit incrementally and it'll simulate (uselessly, but safely) at every intermediate stage.
Sources start switched off whenever their chunk loads. The Power Supply, Current Source,
Function Generator, AC Source and 3-Phase Source switch on when their redstone input changes,
and that on/off state isn't saved. So after a server restart, a world reload, or a trip far
enough away for the chunk to unload, every source is off again, even if its lever is still on.
Flip the lever off and back on (or otherwise retrigger its redstone input) to restart the
circuit. This is intentional.
The R2V/V2R Converters and the four controlled sources (VCVS/VCCS/CCCS/CCVS, see
Advanced Components) are the exception to "leads follow the direction
you were looking when placed": their orientation is always fixed (up = the wired electrical
lead(s), down = the required Ground connection, north/south = redstone I/O or control leads),
regardless of which way you were facing when you placed them. They also physically require a
Ground block directly beneath them to place at all — break that Ground and the converter
or controlled source breaks with it.
The transistors (NPN/PNP/NMOS/PMOS) and the Ideal Op-Amp are 3-terminal components: front
and back are two of the three leads as usual, and the third (base/gate, or the op-amp's V+) is
the block's top face — or its north face, if the block itself is oriented vertically (facing
up or down).
The Transformer is a 4-terminal component and always sits upright: it turns to face you
when you place it, and the face toward you shows the transformer symbol. Seen from that front,
its input (primary) is the left (IN +) and right (IN −) faces, and its output
(secondary) is the top (OUT +) and bottom (OUT −) faces. Each terminal face is labelled
on the block itself. The back face is not a terminal.
Advanced Components
Transistors, the four classic dependent/controlled sources, a single-phase transformer, and a
couple of instrumentation pieces that round out a real bench — sold by the Electronics
Engineer villager (see below), not the Electrician, except the transformer, which is
craft-only for now. All the "simplest model" parameters below (β, threshold voltage,
transconductance, gain) are editable via shift+right-click, the same value-editor convention as
the basic components.
Every dependent source here relies on a deliberate one-tick lag: Circuit.step() stamps every
element before solving, so any element that reads another node's already-solved voltage (or
another source's already-solved current) while building its own stamp is necessarily reading the
previous tick's converged value — the same "linearize about last tick" philosophy the Diode
already used. This is what lets all four controlled sources, the BJTs, and the MOSFETs work
without any change to Circuit's core solve loop (aside from one new stamping helper,
stampTransconductance — see MOD_ARCHITECTURE.md for the full writeup).
| Block/Item |
What it is |
Diode |
The lead facing the direction you were looking when you placed it is the anode, the opposite lead is the cathode - current flows readily anode→cathode past the forward voltage, and is (almost) blocked in reverse. Right-click cycles silicon (~0.7V) / germanium (~0.3V) / red LED (~2V) presets - a categorical choice, so there's no shift+right-click value editor for the diode. Modeled with a linearized Shockley diode equation re-fit every tick, not a lookup table. |
Current Source |
Ideal independent DC current source - the dual of the Power Supply. Cycles 0.1 / 0.5 / 1 / 2 A; shift+right-click opens the value editor for an exact current. Same redstone-activation behavior as the Power Supply (inactive = open circuit until powered). |
Voltmeter |
An ideal voltmeter in series - infinite input impedance, draws no current, never loads down the circuit it's reading. The voltage dual of the Ammeter: pin it with the Probe to see a live voltage trace, same as any other component. |
NPN Transistor |
Collector is the front (facing) lead, emitter the back, base the top face (or north, if placed vertically). Base-emitter junction reuses the Diode's own linearized Shockley model; collector current is β × base current, stamped as an exact transconductance term (no lag) via stampTransconductance. Shift+right-click edits β (current gain), 5–500. |
PNP Transistor |
Same model and leads as the NPN, with every current direction reversed (polarity = -1 in the underlying Bjt model). Shift+right-click edits β, 5–500. |
NMOS Transistor |
Drain is the front lead, source the back, gate the top face (or north, if placed vertically). Square-law, saturation-only model, linearized each tick around the previous drain current. Shift+right-click edits threshold voltage (0.1–5 V) and transconductance k (1e-4–0.1 S). |
PMOS Transistor |
Same model and leads as the NMOS, with drain current direction reversed. Shift+right-click edits the same two parameters. |
VCVS (voltage-controlled voltage source) |
Must be placed directly on a Ground block, like the R2V/V2R Converters. North face senses a control voltage (against Ground); the output (gain × control voltage) is driven onto the top face. Shift+right-click edits the gain, 0.1–100. |
VCCS (voltage-controlled current source) |
Same shape as the VCVS, but drives a current (transconductance × control voltage) out its top face instead of a voltage - stamped as an exact transconductance term, no lag, since it's a purely linear relation. Shift+right-click edits the transconductance, 1e-4–1 S. |
CCCS (current-controlled current source) |
A 4-face component: north/south are the control-current sense leads (an internal 0V ammeter, like the Ammeter block), top drives the output current (current gain × sensed current) against the required Ground below. Shift+right-click edits the current gain, 0.1–100. |
CCVS (current-controlled voltage source) |
Same 4-face shape as the CCCS, driving a voltage (transresistance × sensed current) instead of a current. Shift+right-click edits the transresistance, 1–1,000 Ω. |
Transformer (single-phase) |
An ideal transformer with turns ratio N:M (primary:secondary): V_out = (M/N)·V_in and I_out = (N/M)·I_in. Input on the left (+) and right (−) faces, output on the top (+) and bottom (−) faces, as seen from the front (see Wiring rules). Both sides behave as impedances, not as an ideal source: a load Z on the output looks like (N/M)²·Z from the input, and the output sees the input's source impedance scaled by (M/N)². The two windings are isolated, so the output doesn't need a Ground of its own. Right-click cycles 1:1 / 1:2 / 2:1 / 1:10 / 10:1; shift+right-click edits N and M separately, 1–1,000 turns each. Being ideal, it passes DC as well as AC (a real transformer only passes AC). The Probe reads the output voltage and current; the AC Probe works through it too. No villager sells it yet: craft it (see Crafting recipes). |
Workbench |
Not a circuit component - it has no leads and takes no part in the solver. It's the Electronics Engineer villager's job site block (see below): place one, let an unemployed villager claim it, and it starts selling the rest of this table. |
Three-Phase Components
A whole second electrical "world" living alongside the mono one above — every component here has
a single bundled lead carrying all three phases (A/B/C) at once, rather than three separate
physical connections. A dedicated bundle wire lets you route that bundle anywhere (it merges with
any touching bundle wire or bundled lead, exactly like the mono Wire does for a single node), and
a Bundler/Unbundler pair crosses between the two worlds when you need to. Sold by the Electrical
Engineer villager (see below), not the Electrician or Electronics Engineer.
| Block/Item |
What it is |
3-Phase Wire |
The bundle equivalent of Wire — paints freely in any direction, merges with any touching 3-phase wire or bundled lead. Carries phase A/B/C together as one connection; a plain mono Wire touching it simply doesn't connect (you need a Bundler/Unbundler to cross between the two worlds) — except Ground, which closes either world directly (see below). |
3-Phase Source |
The facing direction is the bundled 3-phase output (three internal sinusoidal sources at the same frequency/amplitude, 120° apart — standard A/B/C phase rotation); the opposite face is an ordinary single neutral lead, wired to a Ground block the same way every other source's "back" lead works. Shift+right-click edits amplitude (12–400 V) and frequency (0.5–5 Hz). Redstone-gated like the Power Supply. |
3-Phase Ammeter |
Three independent ideal ammeters in series, one per phase — both leads bundled, in-line like the mono Ammeter. |
3-Phase Resistor |
Three ordinary resistors in parallel, one per phase, sharing one editable resistance (10–10,000 Ω) — a balanced resistive load/bank. |
3-Phase Inductor |
Same idea, three inductors sharing one editable inductance (0.01–5 H). |
3-Phase Capacitor |
Same idea, three capacitors sharing one editable capacitance (1–1,000 µF). |
Phase Bundler |
Fixed, non-rotatable faces: the bundled lead is always Up, phase A/B/C are always North/East/South. Purely topological — no impedance added, exactly like a plain wire itself — takes three separate mono connections and aliases them directly onto the matching bundle sub-node. |
Phase Unbundler |
Electrically identical to the Bundler (same fixed faces, same zero-impedance aliasing) — a separate block purely so "bundle → three wires" and "three wires → bundle" read as distinct pieces when you're wiring a bench. |
3-Phase Oscilloscope Probe |
Right-click a bundled component to pin it (shift+right-click unpins) — up to 3 channels at once, same as the regular Probe, except each channel now overlays all three phases on one graph in the standard red/yellow/blue phase-color convention, instead of one trace per channel. |
Switchboard |
Not a circuit component — the Electrical Engineer villager's job site block (see below). |
Every 3-phase part is built from three of its mono equivalent — 3× Wire → 1× 3-Phase Wire,
3× Power Supply → 1× 3-Phase Source, 3× Ammeter → 1× 3-Phase Ammeter, 3× Resistor/Inductor/ Capacitor → 1× the matching 3-phase part, 3× Probe → 1× 3-Phase Probe — all shapeless. The
Bundler/Unbundler are each 3× Wire + 1 iron ingot, shaped (an iron ingot centered above vs.
below the row of wire, mirroring each other). See the Crafting recipes
table below for the recipe diagrams.
Ground works in both worlds — a circuitsimcraft:ground block is bundle-conductive as well as
its usual mono conductivity, so a 3-Phase Wire run can end directly at a Ground with no Bundler/
Unbundler needed, exactly like a mono Wire run already could. You only need an Unbundler when you
actually want the three phases split out to separate mono destinations (three individual gauges,
three individual loads, etc.) — not just to close a loop back to 0V.
Crafting recipes
All vanilla ingredients, no dependency on any other mod. Shapeless recipes are shown as a loose set
of ingredients; shaped ones show the actual 3×3 grid layout. Where a recipe accepts either of two
materials in the same slot, both variants are shown stacked as two complete recipes leading to the
same result, rather than merged into one image.
| Recipe |
Notes |
 |
Resistor ×2 — iron nugget, clay ball or coal as the resistive body, iron nugget: leads on both sides of the body, shaped. |
 |
Capacitor ×2 — iron nugget, paper as the historical capacitor dielectric, iron nugget: leads on both sides, shaped. |
 |
Inductor ×2 — iron nugget, copper or iron ingot for the coil, iron nugget: leads on both sides, shaped. |
 |
Memristor ×1 — amethyst shard for the switching medium. |
 |
Power Supply ×1 — 3×3 iron/copper shell around a redstone block core. |
 |
Function Generator ×1 — 3×3 iron/copper shell, quartz + redstone torch core. |
 |
Wire ×9 — three copper ingots in a row, shaped, cheap/bulk. |
 |
Ground ×4 — iron nugget + copper ingot. |
 |
Ammeter ×2 — iron nugget, copper ingot, redstone. |
 |
Voltage Module ×1 — gold nugget, redstone, iron nugget. |
 |
Frequency Module ×1 — amethyst shard, redstone, iron nugget. |
 |
Diode ×2 — iron nugget, redstone, quartz. |
 |
Ideal Op-Amp ×1 — 2 gold nuggets, redstone, quartz. |
 |
Probe ×1 — redstone, iron nugget, and a stick, stacked vertically. |
 |
X-Y Oscilloscope Probe ×1 — redstone, quartz, and a stick, stacked vertically. |
 |
AC Source ×1 — redstone, glowstone dust, gold nugget (shapeless). |
 |
AC Oscilloscope Probe ×1 — redstone, glowstone dust, and a stick, stacked vertically. |
 |
R2V Converter ×1 — 3×3 iron/copper shell around a Comparator core, the vanilla device for reading redstone strength. |
 |
V2R Converter ×1 — 3×3 iron/gold shell around a Comparator core. |
 |
Breadboard ×1 — 3×3, oak planks frame around a redstone-and-iron-nugget core. |
 |
Current Source ×1 — 3×3 gold/copper shell around a redstone block core (the Power Supply's dual). |
 |
Voltmeter ×2 — iron nugget, gold nugget, redstone. |
 |
NPN Transistor ×2 — 2 iron nuggets, quartz, redstone. |
 |
PNP Transistor ×2 — 2 iron nuggets, glowstone dust, redstone. |
 |
NMOS Transistor ×2 — 2 iron nuggets, paper (gate insulation), quartz. |
 |
PMOS Transistor ×2 — 2 iron nuggets, paper, glowstone dust. |
 |
VCVS ×1 — 3×3 copper/gold shell around a Comparator core. |
 |
VCCS ×1 — 3×3 copper/iron shell around a Comparator core. |
 |
CCCS ×1 — 3×3 gold/copper shell around a Comparator core. |
 |
CCVS ×1 — 3×3 gold/iron shell around a Comparator core. |
 |
Transformer ×1 — a column of iron ingots (the core) between two columns of copper ingots (the windings), shaped. |
 |
Workbench ×1 — 3×3, smooth stone frame around a redstone-and-iron-nugget core (the Breadboard's own job-site pattern, restyled in stone). |
 |
3-Phase Wire ×1 — 3× Wire (shapeless). |
 |
3-Phase Source ×1 — 3× Power Supply (shapeless). |
 |
3-Phase Ammeter ×1 — 3× Ammeter (shapeless). |
 |
3-Phase Resistor ×1 — 3× Resistor (shapeless). |
 |
3-Phase Inductor ×1 — 3× Inductor (shapeless). |
 |
3-Phase Capacitor ×1 — 3× Capacitor (shapeless). |
 |
Phase Bundler ×1 — iron ingot centered above a row of 3 Wire, shaped. |
 |
Phase Unbundler ×1 — iron ingot centered below a row of 3 Wire, shaped — the mirror of the Bundler's own recipe. |
 |
3-Phase Oscilloscope Probe ×1 — 3× Probe (shapeless). |
None of these have recipe-book unlock advancements yet, so they won't show a "new recipe" toast —
but they're fully craftable by hand right now. See Contributing if you want to add
those.
All items are also available in their own CircuitSimCraft creative-inventory tab.
The Electrician villager
Place a Breadboard (crafted as shown above) and let an unemployed villager claim it as a job
site; it becomes an Electrician and both sells the mod's own components and buys back
the raw materials needed to craft them, all for emeralds, instead of vanilla trades. It has its
own look, not the default missing-texture placeholder: a slate/steel tool apron with
warning-yellow badge accents, distinct from any vanilla profession's outfit. Like every vanilla
profession, it levels up (Novice → Master) as it successfully trades, unlocking later tiers. Each
level offers at most two components to sell and at most two raw materials to buy (never more,
always both), so no single villager is ever a wall of trades - except Master, which is a
deliberate exception (see below):
| Level |
Sells |
Buys |
| 1 — Novice |
Resistor, Capacitor |
Iron Nugget, Clay Ball |
| 2 — Apprentice |
Power Supply, Function Generator |
Iron Ingot, Copper Ingot |
| 3 — Journeyman |
AC Source |
Gold Nugget, Glowstone Dust |
| 4 — Expert |
Probe, AC Oscilloscope Probe |
Redstone, Stick |
| 5 — Master |
any 2 of Memristor / R2V Converter / V2R Converter |
Amethyst Shard, Redstone (usually both) |
Buy trades collect 8 of the raw material per trade (4 for Amethyst Shard, the rarest
one - a batch you can actually gather without grinding); sell trades keep each component's
original per-trade quantity (1-2 at a time, unchanged from before). Every trade - buy and sell
alike - can now be used 15 times before that villager needs to restock via more trading
(max_uses: 15, a flat number replacing the previous per-tier values of 4-12). Buy prices are
cheaper than sell prices for the same tier, same as a real shop margin: raw materials are worth
less than the finished component they go into.
Not every craftable item is sellable this way anymore - Wire, Ground, Inductor, Voltage Module,
Frequency Module, and the X-Y Oscilloscope Probe were trimmed out to keep to the two-per-level
cap (all six are still simple, cheap crafting-table recipes, unaffected). The Diode isn't trimmed,
just relocated - it's sold by the Electronics Engineer instead (see below), not the
Electrician. Trades are entirely
data-driven (data/circuitsimcraft/{villager_trade,tags/villager_trade,trade_set}/electrician/)
rather than hardcoded in Java - this Minecraft version's VillagerProfession only points at
TradeSet resource keys per level, so rebalancing prices or adding trades is a JSON edit, no
rebuild required. Each level's trade_set amount is set equal to its trade pool's size, so
every listed trade is always offered together rather than a random subset (unlike vanilla
professions, which usually roll a handful from a larger pool) - the only way to guarantee the
"both sell items and both buy items are always present" promise above.
Master is the one deliberate exception. At the user's request, Master's sell pool has three
items (Memristor, R2V Converter, V2R Converter) instead of two, and any given Electrician
randomly offers only two of the three - real vanilla-style randomness, reintroduced on purpose
for this one tier. Minecraft's trade-set system can only randomize across one combined
pool per level, with no way to keep a subset (the two buy trades) deterministic while
randomizing another subset (the three sell trades) within that same level - so Master's full
pool is 5 entries (3 sell + 2 buy) with amount: 4, meaning exactly one entry gets excluded at
random. Most of the time that's one of the three sell items (giving the intended "any two of
three"), but occasionally it's one of the two buy items instead - Master is the only tier where
the "both buy items always present" guarantee isn't absolute.
Electrician's Workshop
The mod ships a ready-made shop as a datapack function - no manual building required. Stand
where you want it (any terrain: it clears its own footprint and pours its own foundation first,
so uneven ground, slopes, or ungenerated chunks are all fine) and run:
/function circuitsimcraft:electrician_shop
This builds a small oak-and-copper workshop with a slab roof, a lightning rod finial (the most
literal "electrician" symbol available), and a Breadboard already placed inside against the back
wall next to a small shelf of stock (wire, a resistor, a capacitor) - ready for a villager to
walk in and take the job:
The function's source (data/circuitsimcraft/function/electrician_shop.mcfunction) is plain
/fill//setblock commands if you want to reskin it - see
MOD_ARCHITECTURE.md for how it was built and verified.
The Electronics Engineer villager
Place a Workbench (crafted as shown above) and let an unemployed villager claim it as a job
site; it becomes an Electronics Engineer and sells/buys the Advanced Components
table above, the same way the Electrician handles the basic one. It has its own distinct look
too — a white lab-coat recolor of the Electrician's own texture, with the badge accents shifted
from warning-yellow to a diode-red glow, so the two professions are never visually confused.
Same leveling (Novice → Master), same "at most two sells and buys per level, never more" rule,
with Master again the deliberate exception:
| Level |
Sells |
Buys |
| 1 — Novice |
Diode, Voltmeter |
Quartz, Paper |
| 2 — Apprentice |
Current Source, NPN Transistor |
Iron Nugget |
| 3 — Journeyman |
PNP Transistor, NMOS Transistor |
Glowstone Dust |
| 4 — Expert |
PMOS Transistor, VCVS |
Gold Ingot |
| 5 — Master |
any 2 of VCCS / CCCS / CCVS |
Redstone Block (usually present) |
Same trading terms as the Electrician throughout: buy trades collect 8 of the raw material
per trade (4 redstone blocks at Master, the priciest one), every trade allows 15 uses
before restocking, and sell prices scale up with tier (2 emeralds at Novice up to 8 at Master,
matching the Electrician's own R2V/V2R-tier pricing for the dependent sources). Master's sell
pool has three items with only two ever offered at once — the same reused "random exclusion"
trick as the Electrician's own Master tier, except here the full pool is 4 entries (3 sell + 1
buy) with amount: 3, so occasionally the excluded entry is the buy trade instead of a sell
item, not just "any two of three" sells.
Electronics Engineer's Workshop
Same idea as the Electrician's Workshop, deliberately built in a different palette so the two
professions' buildings read as distinct at a glance — a stone-brick-and-polished-andesite "lab"
with iron bars and a quartz finial, instead of the Electrician's oak-and-copper cabin:
/function circuitsimcraft:engineer_workshop
This places a Workbench against the back wall with a small stock shelf (a Diode and an NPN
Transistor) next to it, exactly like the Electrician's own shop places a Breadboard and starter
stock. The function's source is
data/circuitsimcraft/function/engineer_workshop.mcfunction — plain /fill//setblock commands,
same as the Electrician's.
The Electrical Engineer villager
Place a Switchboard (crafted the same way as the Workbench and Breadboard — see
Crafting recipes) and let an unemployed villager claim it as a job site; it
becomes an Electrical Engineer and sells/buys the Three-Phase Components
table above — a third profession, alongside the Electrician (basic mono components) and the
Electronics Engineer (advanced mono components), this time for the bundled 3-phase world. Same
leveling (Novice → Master), same pricing/restock conventions as the other two:
| Level |
Sells |
Buys |
| 1 — Novice |
3-Phase Wire, 3-Phase Ammeter |
Copper Ingot ×8 |
| 2 — Apprentice |
3-Phase Source, 3-Phase Probe |
Iron Nugget ×12 |
| 3 — Journeyman |
Phase Bundler, Phase Unbundler |
Glowstone Dust ×4 |
| 4 — Expert |
3-Phase Resistor, 3-Phase Inductor |
Gold Ingot ×4 |
| 5 — Master |
3-Phase Capacitor |
Redstone Block ×1 |
Same trading terms as the other two villagers: every trade allows 15 uses before restocking,
and sell prices scale up with tier — 2 emeralds each at Novice, up to 8–9 emeralds at Expert/
Master for the priciest bundle-graph parts (Bundler/Unbundler at 8, Inductor/Capacitor at 9).
Electrical Engineer's Workshop
Same idea as the other two workshops, in its own distinct palette so all three professions'
buildings read apart at a glance — a deepslate-brick-and-copper "substation" with a lightning
rod finial, instead of the Electrician's oak cabin or the Electronics Engineer's stone lab:
/function circuitsimcraft:electrical_engineer_workshop
This places a Switchboard against the back wall, ready for a villager to walk in and take the
job. The function's source is
data/circuitsimcraft/function/electrical_engineer_workshop.mcfunction — plain
/fill//setblock commands, same as the other two.
Worked-example circuits
Eight ready-made circuits, one datapack function each, the same /fill//setblock-based
approach as the three workshops above — no manual wiring required to get started. Stand where
you want the bench's southwest corner and run one:
/function circuitsimcraft:voltage_divider # Experiment 1: basic voltage divider
/function circuitsimcraft:rc_lowpass # Experiment 2: RC low-pass Bode plot
/function circuitsimcraft:rlc_resonance # Experiment 3: RLC resonance Bode plot
/function circuitsimcraft:half_wave_rectifier # Experiment 4: half-wave rectifier
/function circuitsimcraft:memristor_hysteresis # Experiment 5: memristor pinched hysteresis loop
/function circuitsimcraft:opamp_bode # Experiment 6: op-amp open-loop Bode plot
/function circuitsimcraft:three_phase_load # Experiment 7: balanced three-phase resistive load
/function circuitsimcraft:three_phase_bundle_unbundle # Experiment 8: bundle/unbundle round trip
Each clears its own space, pours its own foundation, wires up the circuit at every
component's default preset (no component in this mod persists a right-click-selected preset
across a save/reload, so a freshly-placed one always starts at its default regardless of what
an experiment calls for), places an unflipped lever on top of the source, and gives you the
right oscilloscope probe for the job. The function's own header comment states the exact
right-clicks needed to reach each experiment's intended component values and the expected
result. The first six are described in full (derivations, predicted numbers, and the physics
behind each) in the mod's companion paper, latex_mod/sections/07_results_experiments.tex,
reproduced here as buildable structures rather than left as a diagram — Experiments 7 and 8 (the
three-phase benches) postdate that writeup and aren't in the paper yet. Experiment 8 is also the
mod's reference build for the Bundler/Unbundler pair: a 3-Phase Source feeds an Unbundler, three
separate mono Resistors (one per phase leg), a Bundler recombining them, a 3-Phase Resistor, and
straight into Ground — demonstrating both directions of the bundle/mono crossing in one bench,
and that Ground closes a bundle run directly with no second Unbundler needed. Their sources live
in data/circuitsimcraft/function/, plain text like every other function in the mod.
Architecture, for anyone extending this
src/main/java/com/rpicos/circuitsimcraft/
sim/ Pure-Java circuit solver — zero Minecraft dependency, unit-testable standalone
block/ Block classes (placement, orientation, right-click interactions)
blockentity/ BlockEntity classes (the actual sim state + circuit wiring per component)
network/ World-side wire connectivity graph + the client<->server probe protocol
item/ The probe item
src/client/java/com/rpicos/circuitsimcraft/client/ HUD rendering, client-side networking
The solver (sim package)
Circuit is a general modified-nodal-analysis engine: node 0 is always ground, every other node
is an integer you allocate with addNode(). Element implementations (Resistor, Capacitor,
Inductor, Memristor, CurrentSource, Vccs, Bjt, Mosfet) stamp themselves into the
conductance matrix each step; VoltageSource gets its own branch-current unknown, the standard
MNA treatment for ideal sources — Vcvs and Ccvs are both thin factories that just build one.
IdealTransformer also gets one branch-current unknown, with the primary/secondary voltage-ratio
constraint stamped into that row; its coefficients are real, so the same element serves the AC
solver unchanged.
Reactive elements use trapezoidal-integration companion models (the same technique SPICE uses)
rather than backward Euler, so LC-type behavior doesn't get artificially damped out; the BJT and
MOSFET models reuse that same "linearize about last tick" spirit (the BJT's base-emitter junction
literally reuses the Diode's own DiodeMath helper). Every dependent/active element's defining
asymmetry versus a passive, reciprocal resistor is captured in one shared stamping helper,
stampTransconductance — see Advanced Components above for the one-tick-lag
reasoning that lets all four controlled sources and both transistor families work without touching
this solve loop at all.
A second, complex-valued solver, AcCircuit, sits alongside it for AC (Bode-plot) analysis:
Complex is a plain immutable complex number, AcElement implementations stamp a frequency-dependent
admittance given an angular frequency directly (no timestep involved), and AcVoltageSource/AcOpAmp
handle sources and the op-amp's two-pole gain model the same "own branch-current unknown" way their
transient counterparts do. CircuitNetworkManager computes the wiring topology once and reuses the
identical node numbering for both solvers, so they can never disagree on which position is which node.
Because this package has no Minecraft imports at all, you can write and run plain-Java tests
against it directly with javac/java — no Gradle, no decompiling Minecraft, fast iteration.
That's how the solver was validated during development: against closed-form RC/RL step responses,
the memristor's analytic charge-controlled ODE, and — for the AC solver — closed-form Bode-plot
references (a resistive divider's flat response, an RC/RL divider's -3dB/45° cutoff point and
20dB/decade rolloff, and the op-amp model's DC gain and pole frequency).
Adding a new component type
- Add the physics to
sim/ if it's a new kind of element (skip this if it's just a different
preset of an existing one).
- Create a
blockentity/YourComponentBlockEntity.java extending ComponentBlockEntity,
implementing addToCircuit, probeCurrent, probeSummary, and cyclePreset.
- Create a
block/YourComponentBlock.java extending ComponentBlock (copy an existing one, e.g.
ResistorBlock.java — it's a ~25-line template).
- Register it in
ModBlocks, ModBlockEntities, ModItems, and add it to ModCreativeTab.
- Add a texture (
textures/block/your_component.png, 16×16 — front/back automatically get the
shared terminal.png lead texture, so you only need the body texture for the other four
faces), a blockstates/your_component.json and models/block/your_component.json (copy an
existing pair — they're generic besides the texture path), and a lang entry.
- Optionally add a
data/circuitsimcraft/recipe/your_component.json.
If your component has 3+ terminals, extend NetworkBlockEntity directly instead of
ComponentBlockEntity (see OpAmpBlockEntity, NpnBlockEntity, or the Vcvs/Vccs/Cccs/Ccvs
family for precedent) and add your own dispatch branch in CircuitNetworkManager.rebuild(). If it
should always sit on a Ground block with a fixed orientation (like the R2V/V2R converters and the
four controlled sources), extend GroundedComponentBlock rather than ComponentBlock directly.
See COMPONENT_ADD.md and MOD_ARCHITECTURE.md for
the full walkthrough, including the second-villager-profession pattern if your component should be
sold by a new profession rather than an existing one.
Known limitations
- Component state resets on circuit rebuild.
CircuitNetworkManager rebuilds the whole
Circuit from scratch whenever wiring changes anywhere in that network, so a capacitor's charge
or an inductor's current resets to zero at that point. The memristor is the exception — its
state fraction is explicitly carried across rebuilds, since persistent state is the entire point
of a memristor. Making the others persist too is a good first contribution.
- No recipe-book unlock advancements — recipes work but won't appear highlighted/toast when
first available.
- AC analysis is small-signal only, and doesn't cover the Advanced Components (except the
Transformer) or the Three-Phase Components at all yet. Every independent source other than the pinned AC Source
is always stamped at 0V during a sweep, regardless of its own redstone-activated state; the
op-amp's two-pole gain (100dB DC gain, poles at 20Hz/3MHz) is a fixed constant, not yet exposed
through the value editor; and the memristor's AC case is simply a frozen resistor with no
frequency dependence of its own modeled yet. The transistors, the four controlled sources, and
every three-phase component simply have no
AcStampable implementation at all, so they behave
as an open circuit during a Bode-plot sweep by omission rather than by any deliberate
small-signal model — a real next contribution, not a design choice.
- The base/gate badge texture on a vertically-placed transistor is unverified. The Java
electrical model is orientation-correct regardless (base/gate is always the block's north face
when placed facing up/down, per the wiring rules above) — what's untested is only whether the
texture painted on that literal north face reads correctly to the player when the block itself
is lying on its side. Confirmed correct for all four horizontal orientations; not yet visually
checked for facing up/down.
- The 3-Phase Oscilloscope's actual on-screen rendering, and the Electrical Engineer's trade
offers, haven't been visually confirmed in a real connected client — both were only verified
via server-side headless testing (real solved circuit values, checked by log) rather than by
looking at the rendered game.
Contributing
Issues and PRs welcome. If you're adding a component, please include a note on the physical model
you used (a link to the equations is enough) — the goal of this mod is that in-game behavior is
actually correct, not just plausible-looking.
Translations
Available in English, Spanish (es_es), Catalan (ca_es), German (de_de),
French (fr_fr), Brazilian Portuguese (pt_br), Simplified Chinese (zh_cn),
Japanese (ja_jp), Korean (ko_kr), Hindi (hi_in), Greek (el_gr) and Russian (ru_ru; block and item names so far, the rest shows in
English) — Minecraft picks the one matching your game language automatically. Every player-visible string is translatable:
block/item names, probe readouts, chat messages, the oscilloscope HUDs and the value editor.
To add a language, you only need one file:
- Copy
en_us.json and name it
after Minecraft's code for your language (e.g. ru_ru.json for Russian, fr_fr.json for
French).
- Translate the values (right-hand side) only. Keep every key exactly as it is.
- Keep every
%s placeholder - each one is filled with a number or a name at runtime, in the
same order as in English. Write %% for a literal percent sign. To reorder placeholders,
use numbered ones: %2$s ... %1$s.
- Units are part of the text, so localize them if your language does (e.g.
ohm -> Ом). The
value editor's units use the optional unit.circuitsimcraft.* keys; any unit without one
falls back to its symbol.
- Open a pull request adding the file to
src/main/resources/assets/circuitsimcraft/lang/, or
just send the file to the maintainer. Any key you leave out falls back to English, so a
partial translation still works.
Thanks to our translators: the Russian translation was contributed by CurseForge user
user_whgfaemh28tr34xm.
Citation
If you use CircuitSimCraft — in a classroom, a paper, a demo, a derivative mod, anywhere — please
credit the authors: Rodrigo Picos, Stavros G. Stavrinides, George Stavrinides, Ariadna Picos,
and Gerard Picos. A link back to this repository is enough for informal use; for academic
work, please cite it as:
Rodrigo Picos, Stavros G. Stavrinides, George Stavrinides, Ariadna Picos, and Gerard Picos.
CircuitSimCraft: a Fabric mod for teaching analog electronics in Minecraft.
https://github.com/rpicos-uib/circuitsimcraft, 2026.
BibTeX:
@software{picos_mine_memristors,
author = {Picos, Rodrigo and Stavrinides, Stavros G. and Stavrinides, George and Picos, Ariadna and Picos, Gerard},
title = {CircuitSimCraft: a Fabric mod for teaching analog electronics in Minecraft},
url = {https://github.com/rpicos-uib/circuitsimcraft},
year = {2026}
}
See also CITATION.cff, which GitHub reads automatically for its "Cite this
repository" button.
License
CC BY 4.0 — see LICENSE. Unlike a
permissive software license (MIT, Apache, etc.), CC BY requires attribution as a legal
condition of reuse, not just a courtesy — the citation above is exactly what satisfies that
requirement for academic use; a link back to this repository is enough for informal use.
评论 0
登录后参与评分
还没有评论,来抢沙发吧