Particles - ShaneBeee/SkBee GitHub Wiki
Particles are a great way to add some spice to your server, especially using the very simple effect.
(lerp|draw|make) %number% [of] %particle% [particle] [using %itemtype/blockdata/dustoption/dusttransition/vibration%] %directions% %locations% [with offset %vector%] [with extra %number%] [(for|to) %players%]
Simple Particles
The most basic uses of the syntax are spawning particles without any extra information, for example if you wanted to spawn 1 of the green stars then you would use something like:
draw 1 happy_villager at player
And of course you can change the count and location to whatever you feel like
Slightly Less Simple Particles
Area Spawning
Building off the example above, you can add more information about the particle spawn. By supplying a vector (it's not scary in this, I swear) you can define a "bubble" in which the particles are allowed to randomly spawn in around the location. The "bubble" size is defined by the numbers you put in the vector and its treated as the radius in that axis.
For example, if you wanted to spawn 20
flame
s randomly in a skinny "bubble" around the player you can do something like (ignore the with extra 0
part, we will get to that soon):
draw 20 flame at player with offset vector(0.5, 2, 0.5) with extra 0
So in that example, 20
flame
particles are spawned in a "bubble" around the player, and that "bubble" extends 2
blocks below, 2
blocks above, and half a block in the negative and positive X and Z axes.
Extra Particle Data
Some particles need some extra data in order for the game to spawn them, notable examples are things like item break particles and redstone dust. The game generally needs more information about the particle so it knows what it should show to the player.
Item break particles (called just item
) just need an item type supplied so it knows the texture to use (again, ignore the with extra 0.1
part, we will get to that):
draw 5 of item using diamond at player with extra 0.1
And of course you can use expressions such as tool of player
instead of diamond
to reference something dynamic.
The redstone dust particle (called just dust) can take in a function from SkBee called dustOption
to define the color and the size of the particle (note that this function only works for dust):
draw 5 of dust using dustOption(orange, 1) at player
The parameters for the function dustOption
are (color, size)
, for color
it can be a literal color (as shown in the example) or you can use the built in rgb
function to give it a color defined by RGB values (such as rgb(255, 0, 255)
for magenta). The second parameter is a number which defines the size of the dust, 1
being default, 2
being double, .5
being half (screenshot of size examples shown below).
Current functions for particles are as follows:
dustOption(color, size)
-- for use with thedust
particledustTransition(fromColor, toColor, size)
-- for use with thedust_color_transition
particlevibration(fromLoc, toLoc, time)
-- for use with thevibration
particle
"Extra" Extra Particle Data
Some particles have some initial random velocity when they spawn, notable ones being things like flame
, smoke
and firework
. Luckily we are able to control the general speed of that motion using the extra
part of the syntax:
spawn 5 of flame at player with offset vector(0, 0, 0) with extra 1
The extra
behaves as a multiplier for the motion, so 1
being default (no change), 0
being no motion and 2
being double
Tips and Quirks
Velocity
Some particles that have initial velocity (as mentioned above) can have their velocity be actually changed when you spawn them, causing them to go in the direction you define. The way you do this is not very intuitive but it works out I swear, you have to spawn the particles with a count of 0
, then the with offset
part of the syntax now becomes the velocity for the particle and the extra
becomes the multiplier:
draw 0 of soul_fire_flame at player with offset vector(1, 0, 0) with extra 1
That will spawn a single soul flame (the blue flame thing), but it will fly in the positive X direction.
Note Colors
The note
particle (the thing that pops out from a noteblock when you click it) can have its color changed when spawned, it follows a similar procedure as above. You have to have a count of 0
, then the X value of the vector is treated as the hue of the note color (starts off as green, moves to yellow, then orange... etc etc back to green), and the extra has to be 1
, for example here is a purple note:
draw 0 of note at player with offset vector(0.5, 0, 0) with extra 1
Potion Swirl
[!IMPORTANT] As of Minecraft 1.20.5, this particle is now called
entity_effect
and also takes in a color for its data.
Example:draw 1 of entity effect using rgb(51,255,187) above target block
The potion swirl (the particles that float around you when you have a potion applied) (called ambient_entity_effect
) can also have its color changed and once again, it follows a similar procedure, but instead of having a function for the color like dust
does, the XYZ of the vector are used as the RGB values (the values are from 0
to 1
instead of 0
to 255
). The extra
also needs to be at 1
for the color to show:
draw 0 of ambient_entity_effect at player with offset vector(0, 1, 1) with extra 1
Image below shows an RGB value of 0, 1, 1
(full green and blue, making a light aqua), setting the count to anything other than 1
will have it choose random colors for each particle.