Options
All
  • Public
  • Public/Protected
  • All
Menu

Custom particle type params object

Hierarchy

  • ParticleDescription

Index

Properties

acceleration?: [number, number, number]

Particle's acceleration, if it's spawned without this parameter. Default is [0, 0, 0]

addLifetimeAfterImpact?: number

Particle will lose given number of ticks from its maximum lifetime, when touching a block. This value makes sense only if collision param is true. Default is 0

animators?: { alpha?: AnimatorDescription; icon?: AnimatorDescription; size?: AnimatorDescription; texture?: AnimatorDescription }

Animators allow to change some properties of the specific particle depending on the time, each animator is described as an object of definite format and can be not described, if it's not needed.

Type declaration

  • Optional alpha?: AnimatorDescription

    Describes the particle's opacity, for the unit value the alpha in the color parameter from the type's description is taken.

  • Optional icon?: AnimatorDescription

    Describes the animation frame, if particle supports it. Must have the value between 0 and 1

  • Optional size?: AnimatorDescription

    Describes the behaviour of particle's size, for the unit size the size from the type's description is taken.

  • Optional texture?: AnimatorDescription

    Describes the animation frame, if particle supports it. Must have the value between 0 and 1

    deprecated

    use icon instead

collision?: boolean

If true, particle won't go through blocks. It reduces performance if there are lots of these particles, default is false.

color?: [number, number, number, number]

Four component color of the particle (RGBA), default is [1, 1, 1, 1]

color2?: [number, number, number, number]

Four component color of the particle (RGBA), default is [1, 1, 1, 1]

emitters?: { death?: SubEmitterDescription; idle?: SubEmitterDescription; impact?: SubEmitterDescription }

Sub-emitters (don't confuse with emitters) describe how specific particle can emit other particles, according to some events, that may happen to it. Each sub-emitter is described as an object of definite format and can be not described if it's not needed.

Type declaration

friction?: { air?: number; block?: number }

Particle's speed modifier in the air and when touching a block. Usually it's a number between 0 and 1, close to 1, but in fact it can be any value. Both values are 1 by default.

Type declaration

  • Optional air?: number
  • Optional block?: number

    Note: this value makes sense only if collision param is true

isUsingBlockLight?: boolean

If true, the particle will be exposed to the world's lighting. If false, the particle will always have maximum brightness. Enabling this parameter may reduce the performance when having lots of particles. Default is false.

keepVelocityAfterImpact?: boolean

If false, particle's speed will be set to zero when touching a block. If true, the speed will be saved. This value makes sense only if collision param is true

lifetime: [number, number]

Minimum and maximum particle's lifetime in ticks

rebuildDelay: number

default value 10

render?: 0 | 2 | 1

Particle's render type: 0 - additive, 1 - without blending, 2 - with blending.

size: [number, number]

Minimum and maximum size of the particle

texture: string

Particle's texture name from 'particle-atlas' resource directory

velocity?: [number, number, number]

Particle's initial velocity, if it's spawned without initial speed parameter. Default is [0, 0, 0]

Generated using TypeDoc