Skip to content

Commit 68d5526

Browse files
chore: update particles for 1.21.9/10 (#651)
* Update colored particles chapter * Add powered particles chapter * Update written for version * Add caution for INSTANT_EFFECT and EFFECt * Fix rising particles caution amend description * Override LATEST_PAPER_RELEASE to 1.21.10 to allow referencing new class * Clarify caution note for FLASH and TINTED_LEAVES particles regarding ARGB color usage * Revert "Override LATEST_PAPER_RELEASE to 1.21.10 to allow referencing new class" This reverts commit 23f09be. --------- Co-authored-by: Matouš Kučera <[email protected]>
1 parent c675ee8 commit 68d5526

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

src/content/docs/paper/dev/api/particles.mdx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Particles
33
description: A comprehensive guide to particle spawning.
44
slug: paper/dev/particles
5-
version: 1.21.5
5+
version: 1.21.9
66
---
77

88
import { Tabs, TabItem, Badge } from "@astrojs/starlight/components";
@@ -236,12 +236,11 @@ Example of spawning 10 potion effect particles in a 2x2x2 area with a slightly t
236236
![Colored potion effect particles](./assets/particles/orange-spell-particles.webp)
237237

238238
:::note
239-
Only the `ENTITY_EFFECT` supports the alpha channel, which is used to create translucent particles.
239+
Only the `ENTITY_EFFECT` particle supports the alpha channel, which is used to create translucent particles.
240240
:::
241241

242242
:::caution
243-
The `EFFECT` and `INSTANT_EFFECT` particles cannot be colored with the API and will always be white. Only thrown potions
244-
can color them.
243+
While `FLASH` and `TINTED_LEAVES` particles take an ARGB color, the alpha channel is ignored.
245244
:::
246245

247246
### Dust particles
@@ -614,6 +613,13 @@ These particles will use `offsetY` as the particle's y-axis velocity.
614613
If you set `offsetX` AND `offsetZ` to `0`, the particle will have almost no x or z-axis velocity, but will still have
615614
a y-axis velocity set by the `offsetY` argument. In both cases, `offsetX` and `offsetZ` are not used in the velocity vector.
616615

616+
:::caution
617+
`EFFECT` and `INSTANT_EFFECT` are [powered particles](#powered-particles) and use [`Particle.Spell`](jd:paper:org.bukkit.Particle$Spell)
618+
as their data. Due to the nature of rising particles' final calculated vertical velocity being very low (in range \[-0.056, 0.056\])
619+
and how powered particles calculate the vertical velocity, the resulting vertical velocity will always be the opposite of
620+
`power` value's sign.
621+
:::
622+
617623
Example of spawning a `GLOW` particle that moves up:
618624
<Tabs syncKey="spawn-type">
619625
<TabItem label="ParticleBuilder">
@@ -735,11 +741,6 @@ location. When they reach the player's y level, their vertical velocity will be
735741

736742
If the player is moving vertically, the particles will attempt to match the player's vertical velocity.
737743

738-
### Splash particles
739-
The `SPLASH` particle uses the `offsetX` and `offsetZ` arguments to determine the particle's velocity vector, if two conditions are met:
740-
1. `offsetY` is `0`
741-
2. Either `offsetX` or `offsetZ` are not `0`
742-
743744
### Damage indicator particles
744745
The `DAMAGE_INDICATOR` particle adds `1.0` to the provided `offsetY`.
745746

@@ -752,3 +753,19 @@ The `DUST_PLUME` particle adds `0.15` to the provided `offsetY`.
752753
### Firefly particles
753754
The `FIREFLY` particle uses `offsetY` as the particle's initial y-axis velocity, however, there is 50% chance for the `offsetY`'s
754755
sign to be inverted. This means that the particle will either move up or down, with equal probability.
756+
757+
### Powered particles
758+
The powered particles multiply the particle's velocity vector by the supplied argument.
759+
:::note
760+
The y component of the vector is calculated as `(verticalVelocity - 0.1) * power + 0.1`.
761+
:::
762+
763+
#### List of powered particles
764+
- EFFECT
765+
- INSTANT_EFFECT
766+
- DRAGON_BREATH
767+
768+
### Splash particles
769+
The `SPLASH` particle uses the `offsetX` and `offsetZ` arguments to determine the particle's velocity vector, if two conditions are met:
770+
1. `offsetY` is `0`
771+
2. Either `offsetX` or `offsetZ` are not `0`

0 commit comments

Comments
 (0)