Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minecraft_script-0.1.404.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

minecraft_script-0.1.404-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

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

Hashes for minecraft_script-0.1.404.tar.gz
Algorithm Hash digest
SHA256 d7f065294d6169a699da07de5058942d91ce25e173a01030b519056658e3cc79
MD5 fbcec17f0ee96ac0a6cdbfafa210fd86
BLAKE2b-256 cf920bad199bc30ffe7f1f95f3c1772fc6ac701f36ebabef0f544eef4964bcaf

See more details on using hashes here.

File details

Details for the file minecraft_script-0.1.404-py3-none-any.whl.

File metadata

File hashes

Hashes for minecraft_script-0.1.404-py3-none-any.whl
Algorithm Hash digest
SHA256 2dac8a83e8db62afa595f11e845ce1afa8151f895e761a4c22810f2a5d1e519e
MD5 f35cbf638f85a5cd2c378bc571b15344
BLAKE2b-256 77c9ab9b6b096b24845b1c8d7f6c5b9560d68ca52cd5238113879c96e1bae277

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