Minecraft Script Programming language
Project description
Minecraft Script
Minecraft script is primarily a tool to make Minecraft Datapack creation easier.
Minecraft Script is an interpreted programming language which goes through the Python interpreter for output.
However, interpretation is not its main feature, and is rather more of a debugging tool, as its sole
purpose is to allow you to validate your code before building it into a full datapack.
Commands
python -m minecraft_script help
python -m minecraft_script run [files: optional, multiple allowed]
python -m minecraft_script build [file]
Objects
Variables
The var keyword can be used to initialize new variables.
Use it by following it by the variable's name, then an equals sign and a value.
var hello2 = 500 // initialized variable "hello2" with value 500
var hello2 = 300 // assigned new value 300 to variable hello2
var hello2 = hello2 + 500 // adds 500 to hello2
Functions
Functions are defined with the "function" keyword. They can be anonymous,
or be attributed a name. Parentheses around the arguments are required (currently, subject to change).
function = (a) => a * 3 // anonymous function
function add = (a, b) => a + b // define a simple add function
add(2, 7) // call the function; returns 9
Builtin Functions
log
The log functions allows you to keep track of values in the console.
It is equivalent to JavaScript's console.log() or Python's print() function.
var hello1 = 500
log(200 + 200) // logs "400" in console
log(hello1, 300) // logs "500, 300" in console
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
File details
Details for the file minecraft_script-0.1.404.tar.gz
.
File metadata
- Download URL: minecraft_script-0.1.404.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f065294d6169a699da07de5058942d91ce25e173a01030b519056658e3cc79 |
|
MD5 | fbcec17f0ee96ac0a6cdbfafa210fd86 |
|
BLAKE2b-256 | cf920bad199bc30ffe7f1f95f3c1772fc6ac701f36ebabef0f544eef4964bcaf |
File details
Details for the file minecraft_script-0.1.404-py3-none-any.whl
.
File metadata
- Download URL: minecraft_script-0.1.404-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dac8a83e8db62afa595f11e845ce1afa8151f895e761a4c22810f2a5d1e519e |
|
MD5 | f35cbf638f85a5cd2c378bc571b15344 |
|
BLAKE2b-256 | 77c9ab9b6b096b24845b1c8d7f6c5b9560d68ca52cd5238113879c96e1bae277 |