Skip to content

Particles

LoganLilypad edited this page Jun 28, 2022 · 5 revisions

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

[insert image of result here]

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 flames randomly in a skinny bubble around the player you can do something like:

draw 20 flame at player with offset vector(.5, 2, .5)

[insert image of result here]

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:

draw 5 of item using diamond at player

[insert image of result here]

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)

[insert image of result here]

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.

Current functions for particles are as follows:

  • dustOption(color, size) -- for use with the dust particle
  • dustTransition(fromColor, toColor, size) -- for use with the dust_color_transition particle
  • vibration(fromLoc, toLoc, time) -- for use with the vibration 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), for example here is a purple note:

draw 0 of note at player with offset vector(ill find the number for purple later, 0, 0) with extra 0

[insert image of result here]

Potion swirl

Potion swirls

Clone this wiki locally