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!

Constructors

Methods

  • 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

  • Detaches the coords system from the entity and leaves it on the current position.

    Returns 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

  • Returns [number, number, number]

    Origin's coords in float array of 3 elements.

  • Moves the coordinate system to given coords, it will cause all particles' transfer.

    Parameters

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

    Returns void

  • Moves the ORIGIN of the coordinate system to given coords.

    Parameters

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

    Returns 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

  • 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

  • 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

  • Terminates any movement of the coordinate system.

    Returns void

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.