Plugin API

Extend SolarMC with plugins written in insty.

Plugins are insty modules that register handlers with the server. The API is designed to be small and event-driven.

module myplugin

import solar::api

export fun register(solar.Server* server) -> void {
    server.on_join(on_join)
}

fun on_join(solar.Player* player) -> void {
    player.send("Welcome to the server!")
}

Concepts

  • Lifecycle: register is called once when the plugin loads; use it to subscribe to events.
  • Events: join/leave, chat, block interactions, and tick hooks.
  • Entities: typed handles for players, worlds, and blocks.

The plugin API tracks the insty rewrite and will stabilize with the first SolarMC release. Follow progress on GitHub and the community forum.