This guide explains how to set up and run the VoiceGuard Minecraft plugin and its Python backend for voice moderation.
- Java 21 (for the plugin)
- Maven (for building the plugin)
- Python 3.10+ (for the backend)
- FFmpeg (for audio decoding)
- pip (Python package manager)
-
Build the Plugin
- Open a terminal in the
plugindirectory. - Run:
mvn clean package
- The plugin JAR will be in
plugin/target/VoiceGuard-1.0.jar.
- Open a terminal in the
-
Install the Plugin
- Copy the JAR to your Minecraft server's
plugins/folder. - Ensure
config.ymlandprivacy.ymlare present in the plugin's resource folder (they will be auto-generated if missing).
- Copy the JAR to your Minecraft server's
-
Configure
- Edit
config.ymlto set the backend URL and other options as needed.
- Edit
-
Install FFmpeg
- Windows:
choco install ffmpeg - macOS:
brew install ffmpeg - Linux:
sudo apt-get install ffmpeg
- Windows:
-
Install Python Dependencies
- Open a terminal in the
backenddirectory. - (Recommended) Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install requirements:
pip install -r requirements.txt
- Open a terminal in the
-
Configure Environment
- Edit
.envto set backend URL, model, and DB path if needed.
- Edit
-
Initialize Database
- (Optional) Run a script to initialize the database, or let the backend auto-create tables on first run.
-
Run the Backend
- Start the FastAPI server:
uvicorn main:app --host 0.0.0.0 --port 8000
- The backend will listen on the port specified in
.env(default: 8000).
- Start the FastAPI server:
- Start the backend first so the plugin can connect.
- Start your Minecraft server with the plugin installed.
- Players will be prompted for privacy consent on join.
- Voice chat will be monitored and analyzed as described in the project plan.
- Backend not reachable:
- Check backend URL in
config.ymland.env. - Ensure backend is running and accessible from the server.
- Check backend URL in
- FFmpeg errors:
- Make sure FFmpeg is installed and in your PATH.
- Python errors:
- Check that all dependencies are installed and the correct Python version is used.
- Plugin errors:
- Check Minecraft server logs for stack traces.
- Reload plugin config:
/voiceguard reload(if implemented) - Opt-out:
/privacy opt-out - Accept/Deny consent:
/acceptor/deny
- To update the plugin, rebuild with Maven and replace the JAR in your server's plugins folder.
- To update the backend, pull the latest code and re-install requirements if needed.
- For production, consider using a process manager (e.g., systemd, pm2, or supervisor) to keep the backend running.
- For best performance, use a GPU for Whisper if available.
- Data and audio files are stored in the backend's
audio_files/directory and the SQLite database.