ToggleLib: Connect a Real Train Controller to Minecraft

ToggleLib for Minecraft bridges physical train simulator handles with in-game railway mods, enabling realistic control and RTM integration. Download and install to transform your gameplay.

Download togglelib for Minecraft 1.12.2, 1.12.1

Original name: togglelib

Minecraft: 1.12.1, 1.12.2

Loaders: Forge

FileVersionLoaderSize
togglelib_1.1.jar1.12.1Forge43 КБDownload
ToggleLib-1.0.jar1.12.2Forge45 КБDownload
togglelib_1.2.jar1.12.2Forge43 КБDownload

ToggleLib

Minecraft has long been a canvas for creative engineering, and railway enthusiasts have built sprawling networks using mods like Real Train Mod (RTM). But what if you could control those virtual trains with a physical train simulator handle? That is exactly what ToggleLib for Minecraft delivers. This lightweight library mod acts as a bridge between specialized hardware—such as the 三鶯重工 OHC-PC01A handle—and your Minecraft world, translating real-world lever movements into in-game actions.

What is ToggleLib?

ToggleLib is a Forge-based library mod that supports train simulator handles in Minecraft. It provides the framework for other mods to detect and interpret handle inputs. The mod identifies connected handles, reads operational data, and fires custom ToggleEvents. These events can be used by train mods like RTM to control throttle, brakes, and reversers, creating an immersive railway simulation.

Key Features of ToggleLib

ToggleLib packs a focused set of capabilities that make it indispensable for hardware-integrated Minecraft setups:

  • Handle Identification: Automatically detects supported train simulator handles, including the 三鶯重工 OHC-PC01A, and reports their presence to the game.
  • Real-Time Data Reading: Continuously reads handle position data—such as lever angles and button states—and converts them into digital signals.
  • ToggleEvent System: Introduces a custom Minecraft input event that mod developers can listen for, enabling seamless integration with existing train control systems.
  • RTM Integration (WIP): Work-in-progress support for Real Train Mod, allowing direct mapping of physical handles to in-game train controls.
  • Developer-Friendly: A comprehensive developer document is in the works, promising clear APIs and examples for modders who want to extend hardware compatibility.

Because ToggleLib focuses purely on input handling, it remains lightweight and compatible with a wide range of Minecraft versions