|Basic Structure Overview|
|Structure In Detail|
|Current Component List|
|Mob Flame effect|
|Particles Entity Integration|
|Animation Controller effects|
|Animation Timeline effects|
Component ConceptThe particle system is component based. What this means is that particle effects are composed via a set of components. In order for an effect to do something, you add a component that handles that aspect of the effect. For example, an emitter usually needs to have rules for its lifetime, thus the effect should have one or more lifetime components that handle lifetime duties for the emitter and emitted particles.The idea is that new components can be added later, and one can combine components (where it makes sense) to get different behaviors. A particle might have a Dynamic component for moving around, and a Collision component for handling interaction with the terrain, for example.Think of components as telling the particle system what you want the emitter or particle to do, rather than exposing a list of particle parameters and having to wrangle those parameters to get the desired behavior.Back to top
NamespacingAll particle effects should be namespaced (in their name).Namespacing involves adding a 'name:' prefix on the effect tag.Regular Minecraft will use the 'minecraft: prefix. See the examples for example names.Back to top
MoLang integrationWhere it makes sense, any field can use a MoLang expression. MoLang expressions are strings, and are defined in the MoLang documentation. The particle system uses some special MoLang variables that particle MoLang expressions can use. Additionally, custom MoLang paramaters can be set in various ways and used in MoLang expressions in effects.
|variable.particle_lifetime||How long the particle lives for|
|variable.particle_age||How long the particle has lived|
|variable.particle_random_1||A random from 0.0 to 1.0 that is constant for the lifetime of the particle|
|variable.particle_random_2||Another random from 0.0 to 1.0 that is constant for the lifetime of the particle|
|variable.particle_random_3||A third random from 0.0 to 1.0 that is constant for the lifetime of the particle|
|variable.particle_random_4||A fourth random from 0.0 to 1.0 that is constant for the lifetime of the particle|
|variable.emitter_lifetime||How long the current loop lasts for the emitter|
|variable.emitter_age||Age since the current loop started for the emitter|
|variable.emitter_random_1||A random from 0.0 to 1.0 that is constant for the current loop of the emitter|
|variable.emitter_random_2||Another random from 0.0 to 1.0 that is constant for the current loop of the emitter|
|variable.emitter_random_3||A third random from 0.0 to 1.0 that is constant for the current loop of the emitter|
|variable.emitter_random_4||A fourth random from 0.0 to 1.0 that is constant for the current loop of the emitter|
|variable.entity_scale||When the effect is attached to an entity, this value is the scale of the entity|
Basic Structure OverviewParticle effects consist of basic render parameters, and a set of components. Components can be placed in any order. Outline:
Structure In DetailOutline:
Current Component ListFor fields in these components, the following shorthand is used:
Initial State Components
Emitter Local Space componentThis component specifies the frame of reference of the emitter. Applies only when the emitter is attached to an entity. When 'position' is true, the particles will simulate in entity space, otherwise they will simulate in world space. Rotation works the same way for rotation. Default is false for both, which makes the particles emit relative to the emitter, then simulate independently from the emitter. Note that rotation = true and position = false is an invalid option.
Emitter Initialization componentThis component allows the emitter to run some Molang at creation, primarily to populate any MoLang variables that get used later.
Emitter Rate Components
Emitter Rate Instant componentAll particles come out at once, then no more unless the emitter loops.
Emitter Rate Steady componentParticles come out at a steady or MoLang rate over time.
Emitter Rate Manual componentParticle emission will occur only when the emitter is told to emit via the game itself. This is mostly used by legacy particle effects.
Emitter Lifetime Components
Emitter Lifetime Looping componentEmitter will loop until it is removed.
Emitter Lifetime Once componentEmitter will execute once, and once the lifetime ends or the number of particles allowed to emit have emitted, the emitter expires.
Emitter Lifetime Expression componentEmitter will turn 'on' when the activation expression is non-zero, and will turn 'off' when it's zero. This is useful for situations like driving an entity-attached emitter from an entity variable.
Emitter Shape ComponentsShape controls both where the particles are emitted from and the initial direction of the particles.
Emitter Shape Point componentAll particles come out of a point offset from the emitter.
Emitter Shape Sphere componentAll particles come out of a sphere offset from the emitter.
Emitter Shape Box componentAll particles come out of a box of the specified size from the emitter.
Emitter Shape Custom componentAll particles are emitted based on a specified set of MoLang expressions.