Draw Shape (Section) — skript-particle
Addon: skript-particle · Category: Section · Since: 1.0.0
Syntax
[sync[hronously]] draw [the] shape[s] [of] %shapes% [%-directions% %-locations/entities%] [to %-players%]Description
Draws the given shapes at the given locations. The shapes will be drawn in the order they are given. The code inside the draw shape section will be executed before drawing begins. You can use `event-shape` or `drawn shape` to get the shape being drawn. Modifying this shape affects the end result, but it does not modify the original shape! This means you can set particle data, or change the shape's location, rotation, or scale, without affecting the shape the next time it's drawn. **Note that this means the section is run once for each shape!** This is the same way the spawn section works in Skript. This is subject to change if people find it cumbersome.
By default, this effect will run asynchronously, meaning it will do all the calculation and drawing on a separate thread, instead of blocking your server's main thread. This is much better if you want to draw a lot of shapes at once, or if you want to draw large and complex shapes. Be aware that this changes the behavior of the section slightly. All the section code will first be executed synchronously, and then the drawing will be done asynchronously. This means that the time the shape appears may be slightly delayed compared to the completion of the section code. Additionally, the code immediately after the draw shape section will be executed immediately, often before the drawing is finished. If you stumble across issues with this, please report them on the Skript-Particles GitHub page and use the synchronous option instead.
Drawing a shape for a duration is async only.
Examples
draw the shape (sphere with radius 1) at player's location
draw the shapes of (a sphere with radius 1 and a cube with radius 1) at player's location for (all players in radius 10 of player)
synchronously draw the shape of a sphere with radius 1 at player's location
draw the shape {_shape} at player's location:
set event-shape's particle to red dust
synchronously draw shape (a sphere with radius 1 and a cube with radius 1) at player's location:
set event-shape's radius to 2