Spawn Particles (Block Action Type)

Spawns particles at a block — including Apoli's own custom particles, which is what lets a raycast or a projectile leave a custom effect where it lands.

Spawns particles at a block. Because it takes a full Particle Effect, it can spawn Apoli’s custom particles — which is what lets a raycast or a fired projectile leave a custom effect exactly where it lands, something /particle through apoli:execute_command cannot express.

Type ID: apoli:spawn_particles

Fields

FieldTypeDefaultDescription
particleParticle EffectThe 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/y/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 is the same figure on all three axes; every component may 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 world-space velocity. Setting any of them spawns one particle per packet so each one is aimed.
anchorhit, center or cornerhitWhere in the block the particles start. hit uses the exact impact point when the action was run from something that has one — 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
    }
}

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
}

Sends six soul flames straight up out of the middle of the block.