Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/storycraft/mcslib
Minecraft command script library
https://github.com/storycraft/mcslib
minecraft minecraft-commands script
Last synced: about 1 month ago
JSON representation
Minecraft command script library
- Host: GitHub
- URL: https://github.com/storycraft/mcslib
- Owner: storycraft
- Created: 2024-11-17T06:24:47.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-17T06:41:49.000Z (about 1 month ago)
- Last Synced: 2024-11-17T07:29:07.656Z (about 1 month ago)
- Topics: minecraft, minecraft-commands, script
- Language: TypeScript
- Homepage:
- Size: 9.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project is WIP and does not work yet.
# `mcslib`: Minecraft command script library
`mcslib` is structural programming language coded using javascript, compiles into minecraft datapack.## Example
Hand ported solution of [baekjoon #2447](https://www.acmicpc.net/problem/2447) from the c language code.https://github.com/user-attachments/assets/2acdf2be-6b0c-423d-bba6-ecfe8ab5c7f9
Run example files using
```bash
npm start --example=
```## Detail
### Data type
Currently mcslib only supports `number` (double precision float) type, like javascript's `number` type.### operator
`+`, `-`, `*`, `/`, `%`, `>`, `<`, `>=`, `<=`, `==`, `!=` operators are supported.
Bitwise operations are not supported since they can be emulated and very slow anyways.
Comparison operators use predicates internally and very fast.Remainder operator works correctly only if they were integer.
### function
Functions can receive arguments and return a value.
Size of the stack frame is calculated on compile time.They uses mcslib's ABI. It's not compatible with minecraft function's arguments and return value.
Compiler will creates compatible function if you export them.
### control flow statements
`if`, `while`, `loop` statements are supported.