Index
Particles Examples Pack
https://aka.ms/MCParticlesPackExamples of various particles can be found in the link above. These are examples of various stand-alone particle effects. The particle effects provided as part of the Minecraft installation are tuned to be used with the Minecraft game, and thus do not serve as good examples. Please refer to the examples in the pack to see various ways to utilize the particle system. To invoke an example particle with the examples particles pack enabled, bring up the console, type "/particle name x y z" where "name" is the name of the particle effect, and x/y/z are the coordinates the particle appears at.For example, "/particle minecraft:example_smoke_puff 0 5 0" will spawn a smoke puff at the origin of the world, 5 blocks up from the bottom of the world. "/particle minecraft:example_smoke_puff ~ ~1 ~5" will create that smoke puff about 5 blocks away from the player.Name | Description |
---|---|
minecraft:example_beziercurve | Demonstrates the use of a bezier curve in an effect |
minecraft:example_bounce | Demonstrates collision detection and bouncing for particles |
minecraft:example_catmullromcurve | Demonstrates the use of a catmull-rom curve in an effect |
minecraft:example_colorcurve | Demonstrates the use of a color-gradient approach to color variation in an effect |
minecraft:example_colorcurve2 | Demonstrates the use of a color-gradient approach with variable spacing in an effect |
minecraft:example_combocurve | Demonstrates the use of a variety of curves in an effect |
minecraft:example_directional_sphere | Demonstrates the use of directional billboard facing in an effect |
minecraft:example_entity_sparkle_box | When attached to an entity, this effect creates a sparkle effect in a box around the entity |
minecraft:example_entity_sparkle_aabb | When attached to an entity, this effect creates a sparkle effect with the rough axis-aligned bounding box around the entity |
minecraft:example_expire_on_contact | Demonstrates particles disappearing when colliding with the terrain |
minecraft:example_flipbook | Demonstrates texture uv flipbook technique, of applying successive frames of a texture for visual animation |
minecraft:example_highrestitution | Demonstrates particle collision with particles gaining energy on each bounce |
minecraft:example_linearcurve | Demonstrates a piecewise linear curve in an effect |
minecraft:example_particle_event_system | Demonstrates various particle events executing |
minecraft:example_smoke_puff | Demonstrates a general smoke puff effect |
minecraft:example_spiral | Demonstrates a parametric motion spiral effect |
minecraft:example_watertest | Demonstrates excluding particles from various block types, in this case, particles only survive in water |
minecraft:fireworks_events_demo | Demonstrates sequencing various particle effects together via events to create a fireworks effect |
Component Concept
The 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 topNamespacing
All 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 topMoLang integration
Where 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.Name | Description |
---|---|
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 Overview
Particle effects consist of basic render parameters, and a set of components. Components can be placed in any order. Outline:Structure In Detail
Outline:Curves
Curves are interpolation values, with inputs from 0 to 1, and outputs based on the curve. The result of the curve is a MoLang variable of the same name that can be referenced in MoLang in components. For each rendering frame for each particle, the curves are evaluated and the result is placed in a MoLang variable of the name of the curve.Events
Events are particle events that can be triggered elsewhere in the .json. An event triggers a particle effect. If the type is "emitter", this will create an emitter of "effect" type at the event's world position, in a fire-and-forget way. "emitter_bound" works similarly, except if the spawning emitter is bound to an actor/locator, the new emitter will be bound to the same actor/locator. If the type is "particle", then the event will manually emit a particle on an emitter of "effect" type at the event location, creating the emitter if it doesn't already exist (be sure to use "minecraft:emitter_rate_manual" for the spawned emitter effect). "particle_with_velocity" will do the same as "particle" except the new particle will inherit the spawning particle's velocity.The events themselves consist of an optional node tree and/or an actual event. When "sequence" is specified, that array will execute in order, with every element executing when that event fires. When using "random", one element will be picked from the array based on the weight.Current Component List
For fields in these components, the following shorthand is used:Emitter Components
Initial State Components
Emitter Local Space component
This 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. Velocity will add the emitter's velocity to the initial particle velocity.Emitter Initialization component
This 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 component
All particles come out at once, then no more unless the emitter loops.Emitter Rate Steady component
Particles come out at a steady or MoLang rate over time.Emitter Rate Manual component
Particle 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 component
Emitter will loop until it is removed.Emitter Lifetime Once component
Emitter will execute once, and once the lifetime ends or the number of particles allowed to emit have emitted, the emitter expires.Emitter Lifetime Expression component
Emitter 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 Lifetime Events component
Allows for lifetime events on the emitter to trigger certain events.Emitter Shape Components
Shape controls both where the particles are emitted from and the initial direction of the particles.Emitter Shape Point component
All particles come out of a point offset from the emitter.Emitter Shape Sphere component
All particles come out of a sphere offset from the emitter.Emitter Shape Box component
All particles come out of a box of the specified size from the emitter.Emitter Shape Custom component
All particles are emitted based on a specified set of MoLang expressions.