Skip to content

Java and Runtime API

A real FX resource running in the client world

The Java API loads the same authored FX used by the editor and owns a separate runtime instance for each playback.

Photon's public playback API is client-only. Load an immutable-ish FX definition, create or let an executor create an FXRuntime, and keep all world/render mutations on the client thread.

Dependency

gradle
repositories {
    maven { url = "https://maven.firstdark.dev/snapshots" }
}

dependencies {
    implementation("com.lowdragmc.ldlib2:ldlib2-neoforge-${minecraft_version}:${ldlib2_version}:all")
    implementation("com.lowdragmc.photon:photon-neoforge-${minecraft_version}:${photon_version}") {
        transitive = false
    }
}

Photon 2.2.4 targets Minecraft 1.21.1/NeoForge 21.1 and requires the matching LDLib2 line. Use the published metadata/current mod file for exact dependency ranges instead of copying an old example version.

Minimal Playback

java
FX fx = FXHelper.getFX(ResourceLocation.parse("mymod:fire"));
if (fx != null) {
    new BlockEffectExecutor(fx, level, pos).start();
}

FX, FXRuntime, executors, particle objects, shader resources, and post processing are annotated or designed for client distribution. Do not reference them from code that a dedicated server must class-load; place integrations in client-only classes/events.

In This Section

Released under the MIT License.