This library is a python interface for cubiomes
Project description
Cubiomes Python Interface (CPI) Documentation
This is an updated fork of the original cubiomespi package. It wraps the Cubiomes library and introduces a clean, object-oriented API in Python to find structures, spawn points, and biomes in Minecraft seeds.
Key Features of this Fork:
- Adds support for Minecraft 1.21 features (
Trial_Chambers, etc.). - Complete standard Python
IntEnumintegration for cleaner Data/Enum interactions. - Added Object-Oriented wrapper (
Generatorclass API). - Cross-platform dynamic compilation via
setuptools.
Installation
You can install this fork directly via pip:
pip install cubiomespi-fork
(Note: Requires Python 3.11+)
Usage / Quick Start
from cubiomespi import Generator, MCVersion, Dimension, BiomeID, Structure
# 1. Initialize a Generator with a specific MC Version, Seed, and Dimension
generator = Generator(MCVersion.MC_1_21, -2197368822535229394, Dimension.DIM_OVERWORLD)
# 2. Get the Biome at 0, 0, 0
biome = generator.get_biome_at(0, 0, 0)
print(f"Biome at 0,0,0: {biome.label}") # "River"
# Comparison is direct and Pythonic!
if biome == BiomeID.plains:
print("Found Plains!")
# 3. Find Spawn Position
spawn_x, spawn_z = generator.get_spawn_pos()
print(f"Spawn: ({spawn_x}, {spawn_z})")
# 4. Find the closest Village within a given range
closest_village = generator.find_closest_structure(Structure.Village, 0, 0, limit=100)
print("Closest Village:", closest_village)
API Documentation
Enum Classes
All core types (BiomeID, Structure, MCVersion, Dimension, BastionType) are standard Python IntEnum classes. This means they are evaluated as interoperable integers in C, while carrying .name and .label descriptors in Python.
MCVersion:MC_1_21,MC_1_20,MC_1_19, etc.Dimension:DIM_OVERWORLD,DIM_NETHER,DIM_END.BiomeID:plains,desert,ocean,river,lush_caves, etc.Structure:Village,Mansion,Desert_Pyramid,Trial_Chambers, etc.BastionType:HOUSING,STABLES,TREASURE,BRIDGE.
The Generator Class
Provides the primary interface for running calculations and looking up seed data.
__init__(mc_version: MCVersion, seed: int, dimension: Dimension)get_spawn_pos() -> tuple[int, int]- Gets the default world spawn point.get_biome_at(x: int, y: int, z: int) -> BiomeID- Gets the Biome at specific X/Y/Z coords.get_structure_pos(structure: Structure, rx: int, rz: int) -> tuple[int, int]- Given region coordinates, returns exact coordinates of the structure.is_viable_structure_pos(structure: Structure, x: int, z: int) -> bool- Validates if a proposed structure position is structurally viable in that biome.find_closest_structure(structure: Structure, cx: int, cz: int, limit: int) -> tuple[int, int]- Locates the absolute closest structure starting from coordinates (cx, cz).find_structure_in_range(structure: Structure, srx: int, srz: int, erx: int, erz: int) -> list[tuple[int, int]]- Checks a rectangular region for any generated instances of a structure.get_stronghold_pos(count=3) -> list[tuple[int, int]]- Returns coordinates of the nearest strongholds.get_bastion_variant(x: int, z: int) -> BastionType- Determines the variant geometry of a bastion at coordinates.get_end_y_height(x: int, z: int) -> int- Returns surface height mapping in the End dimension.
Utility Functions (from cubiomespi.util)
distance_between_structures(s1, s2)- Fast math calc.distance_from_00(c1)- Fast origin calc.distance_between_points(x1, y1, x2, y2)- Quick cartesian distance mapping.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cubiomespi_fork-1.1.1.tar.gz.
File metadata
- Download URL: cubiomespi_fork-1.1.1.tar.gz
- Upload date:
- Size: 502.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786490787e48da7dd5fd139ab7b137d2a386ec60f741e9c7f0c454c35faaaf64
|
|
| MD5 |
b4480a2e0b70897b55c7a3a5797a50a8
|
|
| BLAKE2b-256 |
78fb6deb52764acb1d9e02ff5631604bce0c95fb40be7982492e161eda2ec4e2
|
File details
Details for the file cubiomespi_fork-1.1.1-cp314-cp314-macosx_26_0_arm64.whl.
File metadata
- Download URL: cubiomespi_fork-1.1.1-cp314-cp314-macosx_26_0_arm64.whl
- Upload date:
- Size: 742.6 kB
- Tags: CPython 3.14, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21fc5cf33531011a642376f073106c92ffda0b62aaab28df003a2e336bbfdb52
|
|
| MD5 |
e94c30c4ac2c97a3661a696bd4acf5d6
|
|
| BLAKE2b-256 |
dd40ac7997049990bd829b42b876663fdee5f0392c337a1fc8c6d55464a30510
|