https://github.com/matcool/candy
(WIP) A language that compiles into minecraft functions
https://github.com/matcool/candy
Last synced: 8 months ago
JSON representation
(WIP) A language that compiles into minecraft functions
- Host: GitHub
- URL: https://github.com/matcool/candy
- Owner: matcool
- License: mit
- Created: 2019-06-03T02:05:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-16T02:21:26.000Z (almost 6 years ago)
- Last Synced: 2024-12-28T16:44:50.265Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# candy (WIP)
A language that compiles into minecraft functions
[](https://streamable.com/063av)
Basic example, which compiles to 3 functions
```python
def main:
# Lines starting with a / are not compiled, just put in as is
/say Hello world!
if checkBlock("~ ~-1 ~", minecraft:stone):
say('You are standing on stone!')
self:test()
# This function will say hi
def test:
say('I am from another function')
```
```python
# main.mcfunction
say Hello World!
execute if block ~ ~-1 ~ minecraft:stone run function candy_basic:main_gen0
function candy_basic:test
# main_gen0.mcfunction
say You are standing on stone!
# test.mcfunction
say I am from another function
```
For more examples check the examples folder
# Usage
Run the candy.py file with the desired arguments
```
usage: candy.py [-h] [-o OUTPUT] [--force] file
positional arguments:
file Candy file to compile
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Path for the generated datapack, if omitted will not
be saved anywhere
--force Force datapack even if theres already a folder
```
# Extra info
- Functions with the name of `load` or `tick` will run upon loading (or /reload) and on every tick, respectively