Skip to content

Developer API

github-actions[bot] edited this page Nov 13, 2026 · 3 revisions

Developer API

The api lets your plugin spawn, change and listen to Hyperion models, play effects and work with custom armor. It holds interfaces and small data types only; the Hyperion plugin implements them.

Important

The api is not published to a Maven repository yet. Until it is, build Hyperion and depend on modules/api/build/libs/api-<version>.jar. Once published, it will be compileOnly("dev.vertcode.hyperion:hyperion-api:VERSION").

The pages

Page What it covers
API Models Finding, spawning and changing models, who sees them, your own model files
API Bones Bones: look, transforms, modifiers, items, and locators
API Animations Playing, looping, fading and stopping animations, per player too
API Behaviors Heads, seats, hitboxes, name tags, and writing your own behavior
API Effects Playing effects, building them in code, your own part types
API Armor Armor sets, items, what a player wears, set bonuses
API Events Every event, with examples

Setup

Depend on Hyperion so it loads before your plugin.

paper-plugin.yml:

dependencies:
  server:
    Hyperion:
      load: BEFORE
      required: true
      join-classpath: true

plugin.yml:

depend: [Hyperion]

Add the api as compileOnly. Do not shade it: the Hyperion plugin already carries it.

The entry point

Everything starts at the Hyperion class:

Call What it gives
Hyperion.models() Model blueprints: find, register, reload
Hyperion.tracker() Live models: by entity, by id, near a location
Hyperion.effects() Effects: find, register, play
Hyperion.armor() Armor sets, items and what a player wears
Hyperion.behaviors() Bone behaviors, and registering your own
Hyperion.formats() Model file formats (experimental)

These throw IllegalStateException when Hyperion is not enabled, so call them from onEnable or later, not from a static initializer.

A first example

ModelBlueprint dragon = Hyperion.models().find(Key.key("hyperion", "bosses/dragon")).orElseThrow();

Model boss = dragon.attach(zombie, options -> options.scale(2.5f).viewDistance(64));
boss.bone("head").ifPresent(head -> head.tint(Color.RED).glowing(true));
boss.animator().play("roar");

Two words to know

  • A blueprint (ModelBlueprint) is a loaded model file: its bones, animations and locators. There is one per file.
  • A model (Model) is one live copy of a blueprint in the world. There can be many.

Armor has the same split: an ArmorSet is a loaded file, an ArmorPiece is one slot of it.

Threading

Hyperion runs on Folia and Canvas, so the rules are the same on every platform:

What Where to call it
spawn, attach, teleport, remove On the thread that owns the location or entity. On Folia, that entity's or region's scheduler. On Paper, the main thread.
Getters Any thread
Appearance setters: scale, tint, glow, bone transforms Any thread. They take effect on the model's next frame.
Playing and stopping animations and effects Any thread
Registries: find, register, reload Any thread. Loading runs off the server thread and returns a future.

Events fire on the thread that owns the model or player, except the two load events, which are async. See API Events.

Null safety

Every package is @NullMarked with JSpecify: nothing is null unless it is marked @Nullable. Things that may be missing come back as Optional. IntelliJ and Kotlin read these annotations, so Kotlin sees Color? where the api says @Nullable Color.

Checking the server version

Feature says what the running server has, so you do not compare version numbers:

if (Feature.EQUIPPABLE.available()) {
    // 1.21.2 and later
}

MinecraftVersion version = MinecraftVersion.current();
Feature Since
PLAIN_ATTRIBUTE_KEYS 1.21.2
PLAYER_INPUT_PACKET 1.21.2
EQUIPPABLE 1.21.2
ITEM_MODEL_DEFINITIONS 1.21.4
PACK_FORMAT_RANGE 1.21.9

What is stable

Interfaces marked @ApiStatus.NonExtendable are for calling, not for implementing. Types marked @ApiStatus.Experimental (model formats, per-player bones) may still change.

Clone this wiki locally