Metadata-Version: 2.4
Name: gemdp
Version: 10.0.1
Summary: Fluent Python builders for Minecraft datapacks & resource packs — custom items, enchantments, mob AI, screen overlays, dialogs, worldgen — plus a headless pack simulator for testing without launching the game.
Author: UniversalShift
License: GPL-3.0-only
Project-URL: Homepage, https://github.com/UniversalShift/GemDP
Keywords: minecraft,datapack,resource-pack,mcfunction,generator
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow>=10.0
Dynamic: license-file

# <img src="https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/Gem.gif" width="30" height="30" /> GemDP <img src="https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/Gem.gif" width="30" height="30" />

Python builders for [Minecraft data packs](https://minecraft.wiki/w/Data_pack) and [resource packs](https://minecraft.wiki/w/Resource_pack).

## Features

- **Custom items, tools, weapons & armor**
- **Custom blocks & ores**
- **Custom mobs**
- **Fullscreen overlays**
- **Book systems**
- **Advanced events system**
- **Event-driven AI for mobs**
- **Projectiles & raycasting**
- **Enchantments**
- **Dialogs & triggers**
- **NBT & storage**
- **Testing with the `mc_sim` interpreter**

## Quick start

Install GemDP, then create a project with this layout:

```text
my_pack/
├── first.py
└── assets/
    └── ruby.png
```

`ruby.png` can be any PNG; use 16×16 for a vanilla-style item texture.

```bash
pip install gemdp
```

```python
from pathlib import Path
from gemdp import DataPack, ItemComponent, ResourcePack

ROOT = Path(__file__).resolve().parent
ASSETS = ROOT / "assets"

# Use different names: these become the data-pack and resource-pack folders.
dp = DataPack("ruby_dp", "Ruby demo data", "1.21.11")
rp = ResourcePack("ruby_rp", "Ruby demo resources", "1.21.11")

ruby = rp.add_custom_item(
    namespace="demo",
    item_id="minecraft:clock",
    custom_name="ruby",
    texture_path=str(ASSETS / "ruby.png"),
    datapack=dp,
    item_name={"text": "Ruby", "color": "red"},
    components=ItemComponent().max_stack_size(64).rarity("uncommon"),
)

print(ruby.get_give_command("@s"))
dp.build(ROOT / "out")
rp.build(ROOT / "out")
```

Install `out/ruby_dp` in a world's `datapacks/` folder and enable `out/ruby_rp` from Minecraft's resource-pack screen. Then run `/reload` and use the printed `/give` command.

See [Getting started](https://github.com/UniversalShift/GemDP/blob/main/docs/getting-started.md) for output-folder behavior and the exact install steps.

## Examples

### Ruby datapack

Full material set: ruby, ore, tools, sword, armor set, recipes.

`examples/ruby_family/ruby_family.py`

![ruby items](https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/ExampleRuby.png)

Ore spawns underground in veins.

![ruby ore](https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/ExampleRubyOre.png)

### Steve mob datapack

Segmented display mob, keyframe animations, MobAI with patrol, hit reactions, and goal routing.

`examples/steve_mob/steve_mob.py`

![steve mob](https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/ExampleSteve.png)

### Rules Card

A datapack item that creates server rules at runtime.

`examples/rules_card/rules_card.py`

![rules card](https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/ExampleRulesCard.png)
![rules card menu](https://raw.githubusercontent.com/UniversalShift/GemDP/main/assets/ExampleRulesCardMenu.png)

More runnable examples are in [`examples/`](https://github.com/UniversalShift/GemDP/tree/main/examples/).

## Docs

### Start here

- [Getting started](https://github.com/UniversalShift/GemDP/blob/main/docs/getting-started.md) — install, first item, output folders, and Minecraft install steps
- [API reference](https://github.com/UniversalShift/GemDP/blob/main/docs/api.md) — complete class and method lookup

### Build pack content

- [Custom items](https://github.com/UniversalShift/GemDP/blob/main/docs/custom_items.md) — items, components, recipes, tools, weapons, armor, and item events
- [Custom blocks](https://github.com/UniversalShift/GemDP/blob/main/docs/custom_blocks.md) — blocks, ores, block hooks, loot, and give commands
- [Events](https://github.com/UniversalShift/GemDP/blob/main/docs/events.md) — `EventApp`, block, inventory, entity, and structure rules
- [Projectiles](https://github.com/UniversalShift/GemDP/blob/main/docs/projectiles.md) — hit hooks and firing from an item event
- [Conditions](https://github.com/UniversalShift/GemDP/blob/main/docs/conditions.md) — reusable `execute if` fragments and predicates

### Advanced systems and tests

- [ScreenFX](https://github.com/UniversalShift/GemDP/blob/main/docs/screenfx.md) — fullscreen effects
- [Custom mobs](https://github.com/UniversalShift/GemDP/blob/main/docs/custom_mobs.md) — display entities and MobAI
- [Animations](https://github.com/UniversalShift/GemDP/blob/main/docs/animations.md) — rigs, keyframes, and playback
- [`mc_sim`](https://github.com/UniversalShift/GemDP/blob/main/docs/mc_sim.md) — run generated data packs in Python tests
