Skip to main content

Particles

Module to work with vanilla and custom particles.

Index

Functions

addBreakingItemParticle

  • addBreakingItemParticle(id: number, data: number, x: number, y: number, z: number): void
  • since: 2.4.0b119

    Spawns EParticleType.ITEM_BREAK particles at a given location with a given item in world.

    More about capabilities

    Called only on the client side! Use packets to spawn particles for multiple players.


    Parameters

    • id: number

      numeric item ID

    • data: number

      item data

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

    Returns void

addFarParticle

  • addFarParticle(type: number, x: number, y: number, z: number, vx: number, vy: number, vz: number, data?: number): void
  • Same as Particles.addParticle, but applies far shader to the particle.


    Parameters

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

    Returns void

addParticle

  • addParticle(type: number, x: number, y: number, z: number, vx: number, vy: number, vz: number, data?: number): void
  • Spawns particle of given type on given coords with given velocity and additional parameters in the world.

    More about capabilities

    Called only on the client side! Use packets to spawn particles for multiple players.


    Parameters

    • type: number

      particle type's numeric ID; if you want to spawn vanilla particles, see EParticleType enums

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

      velocity for the particle by X-axis

    • vy: number

      velocity for the particle by Y-axis

    • vz: number

      velocity for the particle by Z-axis

    • optionaldata: number

      additional params, currently don't know how to use, just put 0

    Returns void

getParticleTypeById

line

  • line(type: number, coords1: Vector, coords2: Vector, gap?: number, vel?: Vector, data?: number): void
  • Spawnds particles in line with specified gapness.


    Parameters

    • type: number

      particle type's numeric ID; if you want to spawn vanilla particles, see EParticleType enums

    • coords1: Vector

      start location of line

    • coords2: Vector

      end location of line

    • optionalgap: number

      gapness means step of particles, values more than 1 will increase offsets between particles; randomized

    • optionalvel: Vector

      velocity of spawned particles

    • optionaldata: number

      variant of spawned particles or properties

    Returns void

registerParticleType

  • Registers new custom particle type of given params object.


    Parameters

    Returns number

    Created particle type's numeric ID.