Options
All
  • Public
  • Public/Protected
  • All
Menu

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. Note: emitter can be moved only while being in world, and it works ONLY for custom particles, not for vanilla!

Hierarchy

  • ParticleEmitter

Index

Constructors

Methods

  • attachTo(entity: number): void
  • attachTo(entity: number, x: number, y: number, z: number): void
  • Binds the origin to the given entity's position, resets the coordinate system's speed

    Parameters

    • entity: number

    Returns void

  • Same as attachTo(entity), but adds x, y and z offset to entity's coords

    Parameters

    • entity: number
    • x: number
    • y: number
    • z: number

    Returns void

  • detach(): void
  • Detaches the coords system from the entity and leaves it on the current position

    Returns void

  • emit(type: number, data: number, x: number, y: number, z: number): void
  • emit(type: number, data: number, x: number, y: number, z: number, vx: number, vy: number, vz: number): void
  • emit(type: number, data: number, x: number, y: number, z: number, vx: number, vy: number, vz: number, ax: number, ay: number, az: number): void
  • 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

  • Spawns particle of given and data on given coords, with specified velocity and without specified acceleration.

    Parameters

    • type: number
    • data: number
    • x: number
    • y: number
    • z: number
    • vx: number
    • vy: number
    • vz: number

    Returns void

  • Spawns particle of given and data on given coords, with specified velocity and acceleration.

    Parameters

    • type: number
    • data: number
    • x: number
    • y: number
    • z: number
    • vx: number
    • vy: number
    • vz: number
    • ax: number
    • ay: number
    • az: number

    Returns void

  • getPositionArray(): [number, number, number]
  • Returns [number, number, number]

    the origin's coords in float array of 3 elements

  • move(x: number, y: number, z: number): void
  • Moves the coordinate system to given coords, it will cause all particles' transfer

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • moveTo(x: number, y: number, z: number): void
  • Moves the ORIGIN of the coordinate system to given coords,

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • release(): void
  • 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(enable: boolean): void
  • 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(x: number, y: number, z: number): void
  • Sets the speed of the coordinate system by each axis in blocks per tick, it can be stopped with emitter.stop() or emitter.setVelocity(0, 0, 0)

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • stop(): void

Generated using TypeDoc