Skip to content
Xendergo edited this page May 16, 2021 · 2 revisions

Welcome to the documentation for minecraft wasm runtime, I'll be using assemblyscript for the examples, since that's currently assemblyscript is the only language where using strings is supported.

How to use

For wasm runtime to see your wasm files, you have to put them in the config/wasm folder.

To automatically load a wasm file when a world loads, open or create a file named wasm.json in your world folder. There you can list all the wasm files you want to load. Make sure they're in quotes and between brackets. For example...

[
  "moduleName",
  "yee",
  "whatever"
]

Commands

All commands start with /wasm

/wasm load <module>

You can use this to load a module, automatically unloads the module if it's already loaded

/wasm reload <module>

Does the same thing as load, but provides better suggestions, given reloading a module is your intention

/wasm invoke <module> <function> <arguments>

Invoke a function exported by the module given. Arguments are inputted seperated by spaces. Only numeric types are allowed for the arguments.