Developer API

Learn how to develop against the Waystones API.

Waystones provides an API for developers to interact with the mod, extend certain areas of it, and react to events.

API Overview

You can learn about the available API methods on our GitHub repository.

A good starting point is the WaystonesAPI class, or the various events you can listen to.

If you have any questions or need help, feel free to join our Discord server.

repositories {
    maven {
        url "https://maven.twelveiterations.com/repository/maven-public/"

        content {
            includeGroup "net.blay09.mods"
        }
    }
}

dependencies {
    // Common (mojmap):
    compileOnly "net.blay09.mods:waystones-common:${mod_version}"
    // NeoForge:
    implementation "net.blay09.mods:waystones-neoforge:${mod_version}"
    // Fabric:
    implementation "net.blay09.mods:waystones-fabric:${mod_version}"
}

Rune Resource Pack Definitions

Resource packs can override the rune models and colors of waystones, sharestones, and portstones through JSON files in assets/<namespace>/waystone_runes/<path>.json.

For example, create assets/waystones/waystone_runes/andesite_waystone.json to change the andesite waystone's rune colors while keeping its default model:

{
  "model": "waystones:block/andesite_waystone_runes",
  "color": "#00FFCC",
  "inactive_color": "#444444"
}
FieldDescription
modelModel resource ID (required). For example, waystones:block/andesite_waystone_runes refers to assets/waystones/models/block/andesite_waystone_runes.json.
colorRune tint in #RRGGBB format (required). For waystones, this is used when the local player has activated the waystone.
inactive_colorRune tint for waystones activated by another player (optional). Defaults to #444444. Sharestones and portstones always use color.

The definition's namespace and filename select the type to override:

TypeExample definition path
Waystoneassets/waystones/waystone_runes/andesite_waystone.json
Sharestoneassets/waystones/waystone_runes/amethyst_sharestone.json
Portstoneassets/waystones/waystone_runes/amethyst_portstone.json

For custom types, use the waystone or sharestone type's resource ID as the definition ID. Portstone definitions use the portstone type's resource ID with _portstone appended to its path.