• 9/23/20 1:28 pm
- 2.5k views • 0 today
- save_alt 40 downloads
- Compatibility
- Minecraft 1.13
- to version
- Minecraft 1.19
- Changes include
- Functions
15
Advanced Minecraft Scripting
This project aims at producing a more human readable version of Minecraft's mcfunction format. This documentation will explain the new syntax, the components of the compiler and contains a user guide to use this program to compile your project into a Minecraft datapack.
Please read the docs on GitHub.
The Language
The AMS transpiler does not actually introduce a new language, but offers a way of organizing existing minecraft code into a more readable format using indentation.
parent
line1
#comment
line2
will compile to
parent line1
#comment
parent line2
This can be useful when you need to write a number of similar lines. For example:
execute store result score @s
x1 run data get entity @s Pos[0] 1
y1 run data get entity @s Pos[1] 1
z1 run data get entity @s Pos[2] 1
Parsed through the compiler this is assembled into this valid mcfunction code.
execute store result score @s x1 run data get entity @s Pos[0] 1
execute store result score @s y1 run data get entity @s Pos[1] 1
execute store result score @s z1 run data get entity @s Pos[2] 1
If statements can also be dramatically simplified:
execute if
condition1 run
say Detected Condition 1
function namespace:condition1
condition2 run
say Detected Condition 2
function namespace:condition2
Installation
Python scripts don't necessarily need to be installed. This section will however explain how to set it up.
Setting up the Scripts
After installing python, download this repository either through the github website or using git through the console:
git clone https://github.com/davidkowalk/tabbed_minecraft_scripting.git
or if you don't have git:
wget https://github.com/davidkowalk/tabbed_minecraft_scripting/archive/master.zip -outfile advanced_minecraft_scripting.zip
Once you downloaded (and unpacked) the tool into a folder you would like to store it in you need to resolve the dependencies. This project is only dependent on kivy to generate the user interface. Type
pip install kivy
Install the script as an alias in the console
If you are on windows it's also recommended to run the install.ps1 or install.sh on linux, so you can use the ams-transpiler in the console.
Windows Powershell
PS> .\install.ps1
Searching for profile...
Updating start-up script...
Saving to Disk...
===========
|| DONE! ||
===========
PS >Linux Bash
user: $ ./install.sh
Finding Executable Directory...
Adding alias to startup file...
Update Current Session
===========
|| DONE! ||
===========
Please note that the Windows script will check whether the script is already installed, the Linux script will not. The scripts set the python script as an alias. The install will break if you move the repository after running the script.
After you are done check the install in the console (PowerShell on Windows and the Terminal on Linux) by typing
> ams -h
ams transpiler is designed for mincraft mcfunctions to [...]
See the docs for usage reference.
More like this
4770029
119



Have something to say?
I did not got the time to download it and test myself, but from what you show it seem well designed
May I suggest you to add support for function recursivity and loops ?
I have myself writed in the past a tool to create mcfunctions files
You can find it here https://github.com/Loumardes/BlocCode
in my case, the format was an actual python code with added fonctions
I don't remember if the github repository was up to date, and I definitely should improve the doc if I were to resume the project
Tell me if you want to discuss this on discord or elsewere, and keep up the good work :)
I would suggest you write a ticket on github and maybe someone will branch it :)