Skip to content

⚑⚑ Lightning Fast (~300TPS) Reinforcement Learning environment on latest Minecraft 🏝️

License

Notifications You must be signed in to change notification settings

yhs0602/CraftGround

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

CraftGround - Reinforcement Learning Environment for Minecraft

Wheels (All)) Python package CMake Build Gradle Build Coverage Badge

CraftGround_Logo

Hits

CraftGround provides a lightweight and customizable environment for reinforcement learning experiments using Minecraft.



Installation

Quick start (conda / mamba)

conda create -n my_experiment_env python=3.11
conda activate my_experiment_env
conda install conda-forge::openjdk=21 cmake
sudo apt install libglew-dev
pip install craftground

Quick start (Ubuntu based systems)

Refer to the provided Dockerfile for a complete setup.

sudo apt-get update
sudo apt-get install -y openjdk-21-jdk python3-pip git \
    libgl1-mesa-dev libegl1-mesa-dev libglew-dev \ 
    libglu1-mesa-dev xorg-dev libglfw3-dev xvfb
apt-get clean
pip3 install --upgrade pip
pip3 install cmake # You need latest cmake, not the one provided by apt-get
pip3 install craftground

Setup Headless Environment

Refer to Headless Environment Setup for setting up a headless environment.

Install development version

pip install git+https://github.com/yhs0602/CraftGround.git@dev

Run your first experiment

Example repositories

Example code

from craftground import craftground
from stable_baselines3 import A2C

# Initialize environment
env = craftground.make(port=8023, isWorldFlat=True, ...)

# Train model
model = A2C("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=10000)
model.save("a2c_craftground")

Environment Specifications

For detailed specifications, refer to the following documents:

Technical Details

See Technical Details for detailed technical information.

License and Acknowledgements

This project is licensed under the LGPL v3.0 license. The project includes code from the following sources:

Devaju fonts

Gamma Utils

This project includes code licensed under the GNU Lesser General Public License v3.0:

Fabric-Carpet

This project includes code from the Fabric Carpet project, licensed under the MIT License:

Development / Customization

For detailed development and customization instructions, see Develop.