47 lines
1.8 KiB
Markdown
47 lines
1.8 KiB
Markdown
# IScriptWorld.testForBlock
|
|
|
|
[← IScriptWorld](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 5/16 · [önceki](testForBlock-4.md) · [sonraki](testForBlock-6.md)
|
|
|
|
longDistance - Whether particles should be spawned regardless of the distance
|
|
x - X coordinate of position where particles should be spawned
|
|
y - Y coordinate of position where particles should be spawned
|
|
z - Z coordinate of position where particles should be spawned
|
|
n - How many particles of given type should be spawned
|
|
dx - X random offset that shift particle relative to X coordinate where it spawned
|
|
dy - Y random offset that shift particle relative to Y coordinate where it spawned
|
|
dz - Z random offset that shift particle relative to Z coordinate where it spawned
|
|
speed - The speed of particle, different particles might use this argument differently
|
|
args - Additional arguments that can be passed into a particle, for example for "iconcrack" particle you can pass item numeric ID to spawn item particle for a specific item (F3
|
|
+ H shows the numeric ID of an item)
|
|
|
|
spawnParticles
|
|
|
|
void spawnParticles(IScriptPlayer player,
|
|
EnumParticleTypes type,
|
|
boolean longDistance,
|
|
double x,
|
|
double y,
|
|
double z,
|
|
int n,
|
|
double dx,
|
|
double dy,
|
|
double dz,
|
|
double speed,
|
|
int... args)
|
|
|
|
Spawn vanilla particles only to a specific player.
|
|
|
|
var explode = mappet.getParticleType("explode");
|
|
var pos = c.getSubject().getPosition();
|
|
|
|
c.getWorld().spawnParticles(c.getSubject(), explode, false, pos.x, pos.y, pos.z, 10, 0.1, 0.1, 0.1, 0.1);
|
|
|
|
|
|
Parameters:
|
|
player - The player that you want to limit seeing the particle only to
|
|
type - Particle type, you can use IScriptFactory.getParticleType(String) to get the desired particle type.
|
|
longDistance - Whether particles should be spawned regardless of the distance
|
|
x - X coordinate of position where particles should be spawned
|