Skip to content
JasperLorelai edited this page May 19, 2024 · 21 revisions

Source Code

effect: particles

Description:

Plays a particle effect.

Configuration:

Since 4.0 Beta 13 these options support dynamic values through numeric or string expressions.

Option Description Type Default
particle-name The name of the particle that is displayed. List of particle names. String
count The number of particles that are displayed in the effect. Integer 5
radius Since 4.0 Beta 13. Particles are only shown to players in that radius. Integer 50
speed The speed of the particle Double 0.2
horiz-spread Defines how much the particle is spread horizontally. Double 0.2
vert-spread Defines how much the particle is spread vertically. Double 0.2
x-spread X axis spread. Takes priority over horiz-spread. Double horiz-spread
y-spread Y axis spread. Takes priority over vert-spread. Double vert-spread
z-spread Z axis spread. Takes priority over horiz-spread. Double horiz-spread
force Whether to send the particle to players within an extended range and encourage their client to render it regardless of settings. Normally it's within 32 blocks, with this enabled it's within 512 blocks. Boolean False

Dumb formats:

Some particles have exceptions to how the above values are used in order to configure their custom data:

entity_effect & ambient_entity_effect:

Coloring these particles requires:

  • count: 0 - It'll then only spawn one particle. If you need to spawn more, you'll have to make the effect play multiple times, probably by using a Dummy Buff spell, and having the effect on the buff position, controlling the duration of the particles with the buff's duration, and the interval with the buff position's effect-interval: <ticks>.
  • speed - Used to act like values instead of RGBE, where speed acts like an exponent that makes colors brighter or dimmer. The default for this is 128.
  • x/y/z-offset will be used to control the color as (red, green, and blue) colors respectively. Values must be up to 1.0. This means that the value should be color/255.

Example below. Note that since 4.0 Beta 13, you don't have to calculate the color as the equation will be understood and calculated by MS. You can find a color picker here - set the red, green, and blue values to the RGB color values.

particle-name: entity_effect
count: 0
speed: 1
x-spread: red / 255
y-spread: green / 255
z-spread: blue / 255

note:

Coloring these particles requires:

  • count: 0 - It'll then only spawn one particle. See above for a way to spawn more.
  • speed: 1 - Used as a multiplier for colors.
  • x-spread will be used to control the color. Must be up to 1.0. There are 24 notes and their colors, so the color value should be note/24.
  • y-spread: 0
  • z-spread: 0

Notes

Example below. Note that since 4.0 Beta 13, you don't have to calculate the color as the equation will be understood and calculated by MS.

particle-name: note
count: 0
speed: 1
x-spread: note / 24
y-spread: 0
z-spread: 0

Directional particles:

Some particles have motion. You apply it by having:

  • count: 0 - It'll only spawn one particle.
  • speed: 1 - Acts like a multiplier for the motion.
  • x/y/z-spread - Moton vector

Particle-specific options:

redstone:

Option Type Default
color Color ff0000 (red)
size Integer 1

item_crack:

Option Type
material Material

block_crack, falling_dust, and block_marker:

Option Type
material Block Data

dust_color_transition:

Option Type Default
color Color ff0000 (red)
to-color Color 000000 (black)
size Integer 1

vibration:

Option Type Default
vibration-origin Can be: caster, target, or position (effect's position). position
vibration-relative-offset Vector
vibration-offset Vector
static-destination Boolean false
vibration-destination Can be: caster, target, or position (effect's position). position
arrival-time Integer -1

sculk_charge:

Option Type Default
sculk-charge-rotation Float 0

shriek:

Option Type Default
shriek-delay Integer 0

Example:

lava_buff:
    spell-class: ".buff.DummySpell"
    duration: 10
    effects:
      lava:
        effect-interval: 5
        position: buff
        effect: particles
        particle-name: lava
        horiz-spread: 0.3
        vert-spread: 0.3
        speed: 0.2
        count: 8
Clone this wiki locally