Skip to content

Commands ​

Photon commands are useful for previewing exports and simple bindings. A mod should use the Java API when it owns the effect lifecycle.

A Photon effect started in the world by its resource ID

Commands and Java executors resolve the same exported FX resources; this shield is the real photon:shield_gpu effect.

Open the Editor ​

mcfunction
/photon_editor

The editor can only open in a single-player world.

Bind an FX to a Block ​

text
/photon fx <id> block <x y z> [offset] [rotation] [scale] [delay] [forcedDeath] [allowMulti] [checkState]

Minimal example:

mcfunction
/photon fx photon:fire block ~ ~-1 ~

Full example:

mcfunction
/photon fx photon:fire block ~ ~-1 ~ 0 1 0 0 0 0 1 1 1 10 false false true

checkState removes the effect when the exact BlockState changes. Without it, changing to another block type still removes the effect, but a property-only state change does not.

Bind an FX to Entities ​

text
/photon fx <id> entity <selector> [offset] [rotation] [scale] [delay] [forcedDeath] [allowMulti] [autoRotate]
mcfunction
/photon fx photon:fire entity @e[type=minecraft:minecart,distance=..8] 0 0.5 0 0 0 0 1 1 1 0 false false look

autoRotate accepts:

ModeBehaviour
noneUse only the configured rotation.
forwardRotate from the entity's forward vector.
lookFollow the entity's look vector.
xrotFollow its visual body Y rotation.

Common Parameters ​

ParameterDefaultMeaning
offset0 0 0Local translation added to the anchor.
rotation0 0 0Euler rotation in degrees.
scale1 1 1Root scale.
delay0Start delay in ticks.
forcedDeathfalseDrop remaining particles immediately when the anchor disappears.
allowMultifalsePermit another equivalent FX on the same anchor.

Remove Bound Effects ​

mcfunction
/photon fx remove block ~ ~-1 ~ true
/photon fx remove entity @e[type=minecraft:pig,distance=..10] false photon:fire

The optional resource id limits removal to one FX. force=true removes visible remnants immediately.

Changed 2.2.11 With force=false, an effect whose Timeline has a release section plays it first, then winds down.

Move Between Timeline Sections ​

Since 2.2.11
text
/photon fx section entity <selector> (jump <section> | queue <section> | advance | release) [id]
/photon fx section block <x y z> (jump <section> | queue <section> | advance | release) [id]
mcfunction
/photon fx section entity @s jump Vanish
/photon fx section block ~ ~ ~5 advance photon:spells/laser

Moves the Timeline sections of the effects bound to the entities or the block: jump plays from a section's start at the next tick, queue goes there when the current pass ends, advance stops repeating, and release goes to the release section. The optional resource id limits the command to one FX. Quote a section name that has spaces.

Client Maintenance ​

CommandPurpose
/photon_client clear_particlesRemove Photon particles, clear executor caches, and invalidate cached runtimes.
/photon_client clear_client_fx_cacheDrop cached FX definitions and the cached listing.
/photon_client convertConvert Photon 1 files from ldlib2/assets/photon/fx_old.

Test Post Effects ​

Since 2.2.0
mcfunction
/photonfx list
/photonfx test invert
/photonfx test invert 0.5
/photonfx clear

The test command submits the selected effect every frame until clear is run. The optional weight is 0..1.

Iris Diagnostics ​

Since 2.2.2
mcfunction
/photon_iris status
/photon_iris dump
/photon_iris overlay on
/photon_iris mode auto

dump copies the compatibility report. Composite-mode overrides are diagnostic tools; use auto for normal play.

Released under the MIT License.