Skip to content
TheClashFruit edited this page Apr 6, 2024 · 3 revisions

Import the Mod

Add my maven repo:

maven {
    name = "TheClashFruit's Snapshots"
    url  = "https://mvn.theclashfruit.me/snapshots"
}

Add Wasmer as a mod implementation:

modImplementation("me.theclashfruit:wasmer:0.1.0-alpha+mc1.20.4+chicory0.0.9")

Using the API

Create a Custom Method

public class MyAwesomeMethod extends WasmMethod {
    public MyAwesomeMethod() {
        this.fieldName = "my_awesome_method";

        this.params  = List.of(...);
        this.returns = List.of(...);
    }

    @Override
    public Integer[] execute(Integer... args) {
        // ...
    }
}

Register a Custom Method

Register your methods in preLaunch.

MethodRegistry.register(new MyAwesomeMethod());

Clone this wiki locally