Particles.ParticleEmitter
Index
Constructors
constructor
Constructs new particle emitter with origin in given coords.
Parameters
x: number
y: number
z: number
Returns ParticleEmitter
Methods
attachTo
Binds the origin to the given entity's position, resets the coordinate system's speed.
Parameters
entity: number
Returns void
detach
Detaches the coords system from the entity and leaves it on the current position.
Returns void
emit
Spawns particle of given and data on given coords, without specified velocity and acceleration.
Parameters
type: number
data: number
x: number
y: number
z: number
Returns void
getPosition
getPositionArray
Returns [number, number, number]
Origin's coords in float array of 3 elements.
move
Moves the coordinate system to given coords, it will cause all particles' transfer.
Parameters
x: number
y: number
z: number
Returns void
moveTo
Moves the ORIGIN of the coordinate system to given coords.
Parameters
x: number
y: number
z: number
Returns void
release
Performs the finalization of the native object of the following emitter. It means that you will no longer be able to use the following emitter after calling this method, and the object itself will be removed from the memory. Can be used for optimization purposes.
Returns void
setEmitRelatively
Default is false. It means that the coords of the particles for the following emitter. will be specified in the absolute coordinate system, if enabled, they will need to be set relative to the current position of the emitter. This can be very convenient if you need to make a system of particles completely isolated from the movement of the emitter.
Parameters
enable: boolean
Returns void
setVelocity
Sets the speed of the coordinate system by each axis in blocks per tick, it can be stopped with
emitter.stop()oremitter.setVelocity(0, 0, 0).Parameters
x: number
y: number
z: number
Returns void
stop
Terminates any movement of the coordinate system.
Returns void
Particle emitter allows to change their position after spawn. It represents a coordinate system, where created particles are located and which you can move however you want.
Emitter can be moved only while being in world, and it works ONLY for custom particles, not for vanilla!