https://github.com/storycraft/mcslib
Minecraft command script library
https://github.com/storycraft/mcslib
minecraft minecraft-commands script
Last synced: 3 months ago
JSON representation
Minecraft command script library
- Host: GitHub
- URL: https://github.com/storycraft/mcslib
- Owner: storycraft
- License: mit
- Created: 2024-11-17T06:24:47.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-21T16:05:57.000Z (6 months ago)
- Last Synced: 2025-03-22T03:47:29.925Z (3 months ago)
- Topics: minecraft, minecraft-commands, script
- Language: TypeScript
- Homepage:
- Size: 19.4 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/mcslib)
# `mcslib`: Minecraft command script library
`mcslib` is structural programming language coded using javascript, compiles into minecraft datapack.About language guide, see [guide.md](./guide.md) (in progress)
About language reference, see [reference.md](./reference.md) (in progress)
## Template
See https://github.com/storycraft/mcslib-template## Project milestone
- [x] Expression template literal lexer and parser
- [x] Number type
- [x] String type
- [x] Builtin types and methods(static dispatch)
- [ ] Reference types
- [ ] Function, object, array types
- [ ] Closure and coroutine
- [x] IR lowering
- [x] Command template literal parser
- [x] Execute commands using variable value
- [x] Store command result into variable
- [ ] IR optimization (in progress)
- [x] Loop optimization
- [x] Branch prediction
- [x] Constant folding
- [ ] Codegen optimization (in progress)
- [x] Optimized memory placement
- [ ] Dead code elimination (partial)## Example
Compile example datapack using
```bash
npm start --example=build
```
Run datapack with `intrinsics_datapack`### example:draw_star
Demonstration of string concatenationSource code in `examples/draw-star.ts`
### example:cube_particle
Demonstration of running particle command using variable valueSource code in `examples/cube-particle.ts`
### example:poll
Demonstration of running command using command outputSource code in `examples/poll.ts`
### example:string_methods, example:number_methods
Demonstration of running builtin methodsSource code in `examples/methods.ts`
## License
mcslib and project resources are licensed under MIT license