Skip to main content

A Minecraft data pack creation utility

Project description

Cenerator

A Minecraft data pack creation utility

Features

  • Procedurally generate Minecraft data packs with Python
  • As this is just a fancy way of writing to files, it is fully customizable, for example with functions
  • Some convenient shorthand features
  • Outputs everything in a data pack, ready to go

Installation

Installed with pip, something like

pip3 install -U cenerator

Or perhaps on Windows

py -m pip install -U cenerator

Example usage

See examples/ directory for more examples.

Hello, world!

import cenerator

p = cenerator.Pack('hello_world',
    default_namespace='hello_world',
    description='A hello world datapack made with cenerator',
)


@p.func(tags = ['minecraft:load'])
def hello_world(c):
    c('say Hello, world!')

This outputs a data pack which executes the command say Hello, world! on load.

Macros

The following example showcases use of functions that take c and use it to output commands (referred to as "macros")

def say_with_all(c, format_str, values):
    for v in values:
        c(f'say {format_str.format(v)}')


@p.func(tags = ['minecraft:load'])
def macro(c):
    values = ['John', 'Joe', 'Jane', 'Jill']
    say_with_all(c, 'Hello, {}!', values)
    say_with_all(c, 'Goodbye, {}!', values)

This results in a mcfunction file with some otherwise tedious-to-write code:

say Hello, John!
say Hello, Joe!
say Hello, Jane!
say Hello, Jill!
say Goodbye, John!
say Goodbye, Joe!
say Goodbye, Jane!
say Goodbye, Jill!

This is extremely useful for situations where a lot of code must be repeated with different but constant parameters.

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

cenerator-0.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

cenerator-0.1.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cenerator-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for cenerator-0.1.3.tar.gz
Algorithm Hash digest
SHA256 00ff0e2ac7024fc26dcec9843a64357db0df7002d9a89be103349e48b17e314f
MD5 500625c2785be6d0bea5127fa385f420
BLAKE2b-256 8287685a2f62186f30e3c0ae68e44e5838fb06b308667215c707d9d595927c96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cenerator-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for cenerator-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fdee490ea6023435b28e3af8fbfe70ef643a916e1d059e3ffbe7b18b69985b84
MD5 e19a8b05f7bc03a7f366844b5f51d63f
BLAKE2b-256 5c1dcbbd12bd4b5e0fdcb789d849b1aec3380126bc65ec1ea9dd9eee806f90af

See more details on using hashes here.

Supported by

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