Skip to main content

Minecraft command emulator library

Project description

mcemu

A lightweight, programmatic, and interactive Minecraft Command Emulator designed as a standalone Python library and REPL environment. It simulates a virtual Minecraft environment, allowing you to test, debug, and execute complex command sequences and .mcfunction files without needing to launch the game!

🚀 Features

  • Interactive REPL Environment: Start the engine right from your terminal and type commands in real time. Features colored syntax feedback, auto-suggestions, and deep typo detection.
  • .mcfunction Support: Load and execute function files, complete with support for scheduling and ticking.
  • Robust Entity Management: Create and manage players and entities dynamically within a simulated world, complete with inventory and active effects tracking.
  • Scoreboard Simulation: A fully-featured programmatic scoreboard that replicates the in-game behavior for mathematical operations and player tracking.
  • Command Dispatcher: An exact replica of the Minecraft command-tree parsing structure, enabling you to chain execute contexts.

📦 Installation

To install mcemu directly from PyPI (once published):

pip install mcemu

If you are developing locally, clone the repository and install it in editable mode with development dependencies:

git clone https://github.com/OguzhanUmutlu/mcemu.git
cd mcemu
pip install -e .[dev]

🎮 Usage

Once installed, mcemu exposes a powerful command-line interface. Simply open your terminal and type:

mcemu

This will launch the interactive engine:

Minecraft Command Engine v3.0 (Programmatic API)
Type 'exit' to quit, 'scores' to list scoreboards, 'entities' to list entities.
mcemu> 

Supported Commands

The emulator currently supports the following base commands:

  • clear
  • data
  • effect
  • enchant
  • execute
  • function
  • give
  • item
  • kill
  • return
  • schedule
  • scoreboard
  • summon
  • tag
  • teleport (and tp)
  • tick

Example Interaction

mcemu> scoreboard objectives add kills dummy
data returned 1

mcemu> give @p minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}]} 1
data returned 1

mcemu> effect give @p minecraft:speed 100 2 true
data returned 1

mcemu> entities
- Dev (minecraft:player) at (0.0, 0.0, 0.0) tags: set()
  inventory: {'inventory.0': {'id': 'minecraft:diamond_sword', 'count': 1, 'nbt': '{Enchantments:[{id:"minecraft:sharpness",lvl:5}]}'}}
  effects: {'minecraft:speed': {'duration': 2000, 'amplifier': 2, 'hideParticles': True}}

🧪 Testing

To run the built-in test suite locally, use the provided script:

./run_tests.sh

This automatically sets up a virtual environment and runs pytest across the package.

📄 License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcemu-0.1.3.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcemu-0.1.3-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file mcemu-0.1.3.tar.gz.

File metadata

  • Download URL: mcemu-0.1.3.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcemu-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2e598ca287e52809fa5f3c830e617ea7464e53559a4e9e3a7951a2f8c2bf8317
MD5 b6ffa25428ec723f7369af7b6eae6b4d
BLAKE2b-256 1dbf1c52289f450320112bc1429f820467de44ee13946c5688593c0014644f1c

See more details on using hashes here.

File details

Details for the file mcemu-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mcemu-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcemu-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b52a39f4ee59cfe6f91dfbc2336d2d79d46366b14602df99f9eb48c78b2dcdc0
MD5 0e90439293b1c1e0981bae7fbd0d0e7b
BLAKE2b-256 ec8fa5e9062e303b47c7e0e5a7e0d91ddfd4dae158d071abf1011940f2c1e77f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page