Skip to content

Commit ac23487

Browse files
committed
Added NOTE particle chapter
1 parent c41e872 commit ac23487

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,27 @@ Bukkit.getScheduler().runTaskTimer(plugin,
102102

103103
</details>
104104

105+
## Note particle
106+
The note particle has two different behaviors based on the `count` argument.
107+
- If set to a positive number a random color
108+
(of the preset 24) will be chosen for each spawned particle.
109+
- If set to `0`, the `offsetX` argument will be used as an addition to a **HSB (hue, saturation, brightness)** color format's
110+
hue value, which has a starting point at a green color.
111+
112+
Example:
113+
```java
114+
someWorld.spawnParticle(Particle.NOTE, someLocation, 0, 0.4f, 0, 0);
115+
```
116+
117+
:::tip[Vanilla note particle colors]
118+
To achieve the Vanilla note particle colors you must set the offsetX to a fraction of 24.
119+
120+
Example:
121+
```java
122+
someWorld.spawnParticle(Particle.NOTE, someLocation, 0, 2.0f/24.0f, 0, 0);
123+
```
124+
:::
125+
105126
## Dust particles
106127
The only Vanilla dust particle is the redstone particle. However, you can easily create a custom colored one by passing
107128
[Particle.DustOptions](jd:paper:org.bukkit.Particle$DustOptions) as `data`.

0 commit comments

Comments
 (0)