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.

Variables

The var keyword

The var keyword can be used to initialize new variables.

It can either be simply followed by a variable name, in which case it will default to 0,

or you can directly assign a value to it.

var hello1  // initalized variable "hello1" with value 0 (default)

var hello2 = 500  // initialized variable "hello2" with value 500



hello2 = 300  // assigned new value 300 to variable hello2

hello2 = hello2 + 500  // adds 500 to hello2



logtype hello2 // logs "var" in the console

log hello2  // logs "800" in the console

The const keyword

The const keyword can be used to initialize and define new constants.

Unlike vars, these cannot be reassigned new values. Trying to initialize

a new constant without a value brings raises a Syntax Error.

const hello1  // raises 'Syntax Error: Missing value in const declaration'

const hello1 = 500

hello1 = 300  // raises 'Type Error: Tried to assign new value to const "hello1"'



logtype hello1  // logs "const" in the console

log hello1  // logs "500" in the console

Console logging

Console logging values with log

Logging values in MCS is as simple as typing "log", followed by an expression.

Example:

var hello1 = 500

const hello2 = 600



log 200 + 200  // logs 400 in console

log hello1  // logs 500 in console

log hello2  // logs 600 in console

Console logging types with logtype

Logging types in MCS is equally as simple. To log an object's type, simply type "logtype" followed by the object.

Example:

var hello1 = 500

const hello2 = 600



logtype 400  // logs "number" in console

logtype hello1  // logs "var" in console

logtype hello2  // logs "const" 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.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

minecraft_script-0.1.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minecraft_script-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 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.3.tar.gz
Algorithm Hash digest
SHA256 e2e1b4367cde89754afc544dfd9dec02efe7bf6aa84562d2edefe15487fca422
MD5 87faca2789b72c897541c288abef147d
BLAKE2b-256 6854ab35a2fee165f106f54b8dc40b9e15765698c56908ddaf0f4510e781d1e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minecraft_script-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 68f2ab2dedbc78db725f9e6281ea730ad186863df95e148fada0fc689a704da6
MD5 122a2169467c4c1e1b406324d0b5676a
BLAKE2b-256 64bc0c5b4d3f9178868700c4e9c54ff5435acb2d39b09c9180fa0741c6c4e134

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