Inventory-Manager-CC
A Minecraft inventory management system built on CC:Tweaked. Automates storage sorting, smelting, crafting, and item dispensing across networked computers, turtles, and peripherals — with an optional web dashboard for remote monitoring and control.
Architecture
┌──────────────────────────────────────────────────────────────┐
│ Minecraft World │
│ │
│ ┌──────────────────────┐ modem channels 4200-4204 │
│ │ inventoryManager.lua │◄──────────────────────┐ │
│ │ (master computer) │───────────────────────┤ │
│ └──────┬───────────────┘ │ │
│ │ peripherals │ │
│ ┌─────┴──────┬───────────┐ ┌──────────┴────────┐ │
│ │ chests / │ furnaces │ │ inventoryClient │ │
│ │ barrels │ smokers │ │ (display client) │ │
│ │ │ blasters │ └───────────────────┘ │
│ └────────────┴───────────┘ │
│ ┌──────────────────┐ ┌────────────────────┐ │
│ │ craftingTurtle.lua│ │dropperController │ │
│ │ (auto-craft) │ │ (redstone pulses) │ │
│ └──────────────────┘ └────────────────────┘ │
│ ┌──────────────────────┐ HTTP │
│ │ inventoryWebBridge.lua│─────────────────┐ │
│ └──────────────────────┘ │ │
└────────────────────────────────────────────┼─────────────────┘
▼
┌──────────────────┐
│ Web Server :3001 │ ◄── SQLite
└────────┬─────────┘
│ WebSocket + REST
┌────────▼─────────┐
│ React Dashboard │ (port 80)
└──────────────────┘
Components
In-Game (Lua)
| File | Role | Description |
|---|---|---|
inventoryManager.lua |
Master Controller | The brain — scans all networked chests, auto-sorts/defrags items, auto-smelts ores and food, dispatches crafting jobs, manages composting, fires alerts on low stock, and broadcasts state on modem channel 4200. Requires an attached monitor and wired modem. |
inventoryClient.lua |
Display Client | A read-only dashboard that mirrors the master's state on a separate monitor. Supports search, pagination, and sending item orders back to the master. |
craftingTurtle.lua |
Crafting Worker | Runs on a Crafting Turtle. When the master places ingredients in its grid, it auto-crafts and reports results. Must be connected to the master via wired network. |
dropperController.lua |
Dropper Driver | Pulses redstone to fire items out of a dropper block until empty. Runs on a computer adjacent to the dropper. |
inventoryWebBridge.lua |
Web Bridge | Bridges the in-game modem network to the external web server over HTTP/WebSocket. Forwards state from the master and relays commands from the web dashboard back into the game. |
miningTurtle.lua |
Mining Turtle | Runs on a mining turtle connected to the wired network. Continuously mines downward, auto-dumps inventory to networked storage, auto-refuels from storage, and triggers master scans after dumping. |
listDevicesByType.lua |
Diagnostic Utility | Lists all peripherals on the wired network grouped by type. Useful for discovering connected chests, furnaces, etc. |
autorun/startup.lua |
Opus Autorun | Auto-detects the computer's role from config files and launches the appropriate program. For use with Opus OS. |
Web Stack (Docker)
| Component | Description |
|---|---|
Server (web/server/) |
Express + WebSocket API backed by SQLite. Receives state from the Lua bridge, persists item history, and pushes real-time updates to browser clients. |
Client (web/client/) |
React SPA (Vite + Zustand) served via Nginx. Tabbed panels for inventory grid, smelting, crafting, analytics, alerts, and settings. |
| Docker Compose | Orchestrates server and client containers on an internal bridge network. Only port 80 is exposed; the Nginx client proxies API/WS requests to the server. |
Quick Start
Prerequisites
- Minecraft with CC:Tweaked installed
- A CC:Tweaked computer with a wired modem and monitor attached
- HTTP access enabled in the CC:Tweaked config (for the web bridge)
1. Install the Master Controller
On your main CC:Tweaked computer (with the monitor and wired modem), open the terminal and run:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/inventoryManager.lua startup.lua
This downloads inventoryManager.lua and saves it as startup.lua so it runs automatically on boot. Reboot the computer or run startup.lua to start.
2. Install a Display Client (Optional)
On a separate CC:Tweaked computer with a monitor:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/inventoryClient.lua startup.lua
3. Install the Crafting Turtle (Optional)
On a Crafting Turtle connected to the wired network:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/craftingTurtle.lua startup.lua
4. Install the Dropper Controller (Optional)
On a computer adjacent to a dropper block:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/dropperController.lua startup.lua
5. Install a Mining Turtle (Optional)
On a Mining Turtle connected to the wired network:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/miningTurtle.lua startup.lua
6. Install the Web Bridge (Optional)
On any CC:Tweaked computer with a wired modem and HTTP access:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/inventoryWebBridge.lua startup.lua
Configure the web server URL by editing .webbridge_config on the computer, or it will default to http://localhost.
7. Start the Web Dashboard (Optional)
On the host machine, navigate to the web/ directory and run:
docker compose up -d --build
The dashboard will be available at http://localhost on port 80.
Modem Channels
| Channel | Purpose |
|---|---|
| 4200 | Master → Clients/Bridge (state broadcast) |
| 4201 | Clients/Bridge → Master (orders & commands) |
| 4202 | Master → Client (order/craft result replies) |
| 4203 | Master → Crafting Turtle (craft requests) |
| 4204 | Crafting Turtle → Master (craft results) |
| 4205 | System channel (remote reboot all computers) |
Auto-Updating Startup Scripts
The startup/ directory contains self-updating startup scripts that download the latest code from the git repository before launching. These are an alternative to the manual wget install:
| Script | Role |
|---|---|
startup/manager.lua |
Master controller with auto-update for all manager modules |
startup/client.lua |
Client with auto-update, first-run setup wizard, and optional dropper |
startup/turtle.lua |
Crafting turtle with auto-update |
startup/bridge.lua |
Web bridge with auto-update |
startup/miner.lua |
Mining turtle with auto-update |
To use one, download the appropriate startup script as startup.lua on the target computer. For example:
wget https://git.spatulaa.com/MayaTheShy/Inventory-Manager-CC/raw/branch/main/startup/manager.lua startup.lua
License
See LICENSE for details.