Skip to content

Machine Effects (Photon) ​

Since 21.1.1Requires Photon 2.2.5

A machine can play Photon particle effects: continuously while it is in a state, or fired at a moment by a blueprint. Effects are authored in the Machine FX view of a machine project, previewed there, and referenced by name.

Machine FX editor: the state tree and FX library on the left, a machine preview with particles and a timeline in the centre, and the effect's configuration in the Inspector
The Machine FX view. One view owns both lists — per-state effects and the named library — and previews the selected one on the machine.

Photon is optional

MachineFXConfig holds a ResourceLocation and a few numbers — no Photon types. A definition authored with Photon installed loads unchanged on a client or server without it; the effects simply never play. The editor's fx picker still exists and finds nothing.

Two lists ​

ListLives onStarts and stopsUse for
State effectsA machine stateAutomatically, with the state"What this machine looks like while it is working"
FX libraryMachine SettingsOn demand, by nameA moment: a craft completing, an explosion, a burst

State effects follow the same inheritance rule as renderer, shape and machineSound: the toggle disabled means inherit the parent state's list, not no effects. A state that genuinely wants silence enables the toggle and leaves the list empty.

State effects are also the only kind a player who arrives later will see. playMachineFX reaches players tracking the chunk now.

Configuring one effect ​

Inspector showing the fields of a MachineFXConfig: name, FX, offset, rotation, scale, delay, forced death, replace existing, follow facing, max distance
The full configuration of one effect.
FieldDefaultMeaning
NamefxThe identifier it plays under. Also the name a blueprint fires it by
FXphoton:exampleThe Photon effect id, namespace:path — no fx/ prefix, no .fx suffix
Offset0,0,0From the centre of the machine's block
Rotation0,0,0Degrees
Scale1,1,1
Delay0Ticks before it starts
Forced DeathoffDrop remaining particles immediately on stop, instead of letting them drain
Replace ExistingoffWhether starting it again replaces a running effect with the same identifier. Off makes a per-tick "play" call idempotent
Follow FacingonRotate offset and rotation by the machine's front facing
Max Distance64How far from the player the effect may start

Max Distance is a start gate, not a cull: block entities tick for the whole loaded chunk radius, not render distance, so without it a machine coming into range spawns a particle system nobody is near. An effect already running keeps running until its state ends or the chunk unloads.

Previewing ​

The centre pane plays the selected effect on the machine model, with a transport and a scrub bar.

Machine FX view with the state tree, the machine preview and the playback timeline
Play, stop, restart, and scrub to a tick. The preview runs on a seeded random source, so replaying the same effect gives the same picture — which is what makes comparing an edit against the last run meaningful.

Firing one from a blueprint ​

The mbd2/machine/fx group has four nodes:

NodeDoes
Play Machine FXStart a named entry from the machine's FX library
Stop Machine FXStop whatever is playing under an identifier
Emit Photon FXStart an effect described inline — id, offset, rotation, scale, delay
Kill Photon FXStop an inline effect

Prefer Play Machine FX: a library entry is authorable and previewable in the editor. Use Emit Photon FX only when the blueprint computes the effect rather than picking one.

All four are relayed from the server to tracking clients, so a blueprint on a server event can fire them.

Identifiers are one namespace

playMachineFX and emitPhotonFx share the identifier space, and state effects reserve the state: prefix. Starting a second effect under an identifier already in use is either refused or replaces it, per Replace Existing — so calling Play Machine FX every tick while a state is active is a no-op, not a particle storm.

Checklist ​

  1. Author or install the Photon effect and note its id.
  2. Add it to a state's list for a continuous effect, or to the machine's FX library for a fired one.
  3. Set Follow Facing unless the effect is meant to stay world-aligned.
  4. Preview it, scrub to the tick you care about, and check the offset against the model.
  5. Lower Max Distance for anything dense.
  6. Test on a client without Photon installed: the machine must still load.

Released under the MIT License.