Particles
There are two methods to spawn particles:
World.spawnParticle()
which spawns the particle for all players andPlayer.spawnParticle()
which spawns the particle only for the player.
Most particles do not require the additional extra
and data
fields. This guide explains how the particles that do
use these arguments, behave based on their value.
Directional particles
Section titled “Directional particles”This type of particle has an initial velocity when spawned. The velocity can be determined in two different ways, however
both take into account the extra
argument as speed.
Random direction
Section titled “Random direction”Setting the count
parameter to anything positive will yield a random direction for the velocity. The offset arguments are used as random
spawn offset from the location.
Specified direction
Section titled “Specified direction”To specify the velocity’s direction, set the count
argument to 0
and use the offset arguments as the direction vector.
List of directional particles
Section titled “List of directional particles”Show list
- BUBBLE,
- BUBBLE_COLUMN_UP,
- CAMPFIRE_COSY_SMOKE,
- CAMPFIRE_SIGNAL_SMOKE,
- CLOUD,
- CRIT,
- DAMAGE_INDICATOR,
- DRAGON_BREATH,
- DUST_PLUME,
- ELECTRIC_SPARK,
- ENCHANTED_HIT,
- END_ROD,
- FIREWORK,
- FLAME,
- FLASH,
- GLOW_SQUID_INK,
- LARGE_SMOKE,
- POOF,
- REVERSE_PORTAL,
- SCRAPE,
- SCULK_CHARGE_POP,
- SCULK_SOUL,
- SHRIEK,
- SMALL_FLAME,
- SMOKE,
- SNEEZE,
- SNOWFLAKE,
- SOUL,
- SOUL_FIRE_FLAME,
- SPIT,
- SPLASH,
- SQUID_INK,
- TOTEM_OF_UNDYING,
- TRIAL_SPAWNER_DETECTION,
- TRIAL_SPAWNER_DETECTION_OMINOUS,
- WAX_OFF,
- WAX_ON,
- WHITE_SMOKE.