Skip to main content

Particles

A global API which is used for dealing with Minecraft's particles

Particles instances are created when indexing their id

Accessed using the name "particles"


newParticle()

Creates a particle with the given name at the specified position, with the given velocity

Some particles have special properties, like the "dust" particle

For these particles, the special properties can be put into the "name" parameter, the same way as it works for commands

caution

Particle behavior and spawning methods vary per particle, refer to the /particle command for assistance spawning some particles

newParticle(name, pos, vel)

Parameters:

NameTypeDescriptionDefault
nameStringThe particle's java edition idRequired
posVector3The position in the world the particle will spawn in atRequired
velVector3-The particle's original velocity

Returns:

TypeDescription
ParticleReturns the spawned particle for chaining

Example (Overload 2):

-- smoke example
particles:newParticle("smoke", player:getPos(), vec(0, 5, 0))
-- dust example
particles:newParticle("dust 1 0 1 1", player:getPos(), vec(0, 5, 0))

removeParticles()

Removes all particles spawned from this avatar

removeParticles()

Returns:

TypeDescription
ParticleAPIReturns the particle api for chaining

Example:

particles:removeParticles()

isPresent()

Checks if this particle id is registered

isPresent(id)

Parameters:

NameTypeDescriptionDefault
idStringThe particle namenil

Returns:

TypeDescription
BooleanReturns true or false value depending on if the particle is registered

Example:

particles:isPresent("minecraft:smoke")