Skip to main content

Spawn Particles (Block Action Type)

Spawns particles at a block. It takes a full Particle Effect, so it can spawn Apoli's custom particles. That lets a raycast or a fired projectile leave a custom effect exactly where it lands, which /particle through apoli:execute_command can't do.

Type ID: apoli:spawn_particles

Fields

FieldTypeDefaultDescription
particleParticle EffectrequiredThe particle to spawn.
countInteger or Expression1How many particles to spawn.
speedFloat, Expression or Vector0Vanilla's particle speed parameter, or a vector used as the velocity when velocity_x, velocity_y and velocity_z are all zero.
forceBooleanfalseSends the particles to players up to 512 blocks away instead of 32, and ignores their particle setting.
spreadFloat, Vector or Expression0.25 on each axisHow far the particles scatter from the origin. A single number applies to all three axes, and every component can be an expression.
offset_x, offset_y, offset_zFloat or Expression0Moves the spawn point, in blocks, along the world axes.
velocity_x, velocity_y, velocity_zFloat or Expression0Gives every particle this velocity in world space. Setting any of them spawns one particle per packet so each one is aimed.
anchorString (hit, center or corner)hitWhere in the block the particles start. hit uses the exact impact point when the action was run from something that has one, such as a raycast's block_action or a projectile's block_action_on_hit, and falls back to the block centre otherwise. center and corner always use the block centre and its lower corner.

Examples

{
    "type": "apoli:raycast",
    "distance": 32,
    "block_action": {
        "type": "apoli:spawn_particles",
        "particle": {
            "type": "apoli:custom",
            "texture": "example:textures/particle/spark.png",
            "size": 0.3,
            "lifetime": 20,
            "color": "#FFAA33",
            "roll": "rUni(0, 360)"
        },
        "count": 12,
        "spread": 0.15,
        "speed": 0.1
    }
}

This puts a burst of custom sparks exactly where the ray hits, each one at a random roll.

{
    "type": "apoli:spawn_particles",
    "particle": "minecraft:soul_fire_flame",
    "count": 6,
    "anchor": "center",
    "velocity_y": 0.4
}

This sends six soul flames straight up out of the middle of the block.