Minecraft Factory Stats Documentation

Overview
A real-time monitoring system for Minecraft factories using ComputerCraft

This project enables real-time monitoring of Minecraft factories by combining ComputerCraft computers with a modern web stack. The system consists of three main components:

  • ComputerCraft Lua scripts for data collection
  • Go WebSocket relay server for data transmission
  • Next.js frontend for data visualization
System Architecture

1. ComputerCraft Layer

ComputerCraft computers are placed within your Minecraft factory to monitor various metrics such as item counts, energy levels, and machine status.

2. WebSocket Relay

A Go server acts as a relay between the ComputerCraft computers and the web interface, handling real-time data transmission using WebSockets.

3. Web Dashboard

The Next.js frontend provides a real-time visualization of your factory metrics with charts, graphs, and status indicators.

Data Flow Diagram

The diagram above illustrates the system's data flow:

  1. ComputerCraft computers collect data from factory sensors
  2. Data is transmitted to the Go relay server via WebSocket
  3. The relay server processes and queues the data
  4. Data is broadcasted to all connected dashboard clients
  5. The Next.js frontend displays real-time visualizations
Technologies Used
ComputerCraft
Lua
Go
WebSocket
Next.js
TypeScript
Tailwind CSS
Setup Instructions
  1. Install ComputerCraft:

    Ensure ComputerCraft or CC: Tweaked is installed in your Minecraft modpack.

  2. Setup the Go Relay Server:

    Clone the repository and run the Go server on your machine or a hosted environment.

  3. Configure ComputerCraft:

    Place computers in your factory and upload the monitoring scripts. Configure the WebSocket endpoint in the Lua scripts.

  4. Access the Dashboard:

    Open the web dashboard and connect it to your relay server to start monitoring your factory in real-time.