Skip to content

Python scripts to generate Minecraft functions that allow players to enhance their builds.

License

Notifications You must be signed in to change notification settings

msb/minecraft-functions

Repository files navigation

Minecraft Function Generation

This is a Python package for generating Minecraft functions that allow players to enhance their builds.

Generating Custom Functions with Python

Minecraft custom functions are simply a list of commands with no other programming constructs. I have starting experimenting with generating these functions using python scripts. For example, this project contains domes.py that generates a set of functions that create glass domes with varying sizes and colours. A container has been provided with the required python libraries and can be built and run with docker-compose:

# dome
docker-compose run --user $(id -u):$(id -g) dome-java

# ring
docker-compose run --user $(id -u):$(id -g) ring-java

# cloudtree
docker-compose run --user $(id -u):$(id -g) cloudtree-java

# maze
docker-compose run --user $(id -u):$(id -g) cloudtree-java

The dome/ring size and material can be varied by editing the configuration files. Also bedrock versions of the functions can be generated by swapping in the -bedrock suffix (if available):

# dome
docker-compose run --user $(id -u):$(id -g) dome-bedrock

Copying structures between worlds.

As you can't easily copy/paste structures between bedrock worlds, a tool has been developed to scan a world for structure blocks and converts the structures of any it finds to a set of bedrock functions as follows:

minecraftfunctions structure bedrock $PATH_TO_BEDROCK_WORLD $PATH_FOR_BEDROCK_FUNCTIONS $PWD/config/structure.bedrock.yaml

About

Python scripts to generate Minecraft functions that allow players to enhance their builds.

Resources

License

Stars

Watchers

Forks

Packages

No packages published