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
Particle behavior and spawning methods vary per particle, refer to the /particle command for assistance spawning some particles
- Overload 1
- Overload 2
- Overload 3
- Overload 4
- Overload 5
- Overload 6
newParticle(name, pos)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
pos | Vector3 | The position in the world the particle will spawn in at | Required |
Returns:
Type | Description |
---|---|
Particle | Returns the spawned particle for chaining |
newParticle(name, pos, vel)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
pos | Vector3 | The position in the world the particle will spawn in at | Required |
vel | Vector3 | - | The particle's original velocity |
Returns:
Type | Description |
---|---|
Particle | Returns the spawned particle for chaining |
newParticle(name, posX, posY, posZ)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
posX | Number | The x position in the world the particle will spawn in at | Required |
posY | Number | The y position in the world the particle will spawn in at | 0 |
posZ | Number | The z position in the world the particle will spawn in at | 0 |
Returns:
Type | Description |
---|---|
Particle | Returns the spawned particle for chaining |
newParticle(name, pos, velX, velY, velZ)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
pos | Vector3 | The position in the world the particle will spawn in at | Required |
velX | Number | - | The particle's original x velocity |
velY | Number | - | The particle's original y velocity |
velZ | Number | - | The particle's original z velocity |
Returns:
Type | Description |
---|---|
Particle | Returns the spawned particle for chaining |
newParticle(name, posX, posY, posZ, vel)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
posX | Number | The x position in the world the particle will spawn in at | Required |
posY | Number | The y position in the world the particle will spawn in at | 0 |
posZ | Number | The z position in the world the particle will spawn in at | 0 |
vel | Vector3 | - | The particle's original velocity |
Returns:
Type | Description |
---|---|
Particle | Returns the spawned particle for chaining |
newParticle(name, posX, posY, posZ, velX, velY, velZ)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | The particle's java edition id | Required |
posX | Number | The x position in the world the particle will spawn in at | Required |
posY | Number | The y position in the world the particle will spawn in at | 0 |
posZ | Number | The z position in the world the particle will spawn in at | 0 |
velX | Number | - | The particle's original x velocity |
velY | Number | - | The particle's original y velocity |
velZ | Number | - | The particle's original z velocity |
Returns:
Type | Description |
---|---|
Particle | Returns 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:
Type | Description |
---|---|
ParticleAPI | Returns the particle api for chaining |
Example:
particles:removeParticles()
isPresent()
Checks if this particle id is registered
isPresent(id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | String | The particle name | nil |
Returns:
Type | Description |
---|---|
Boolean | Returns true or false value depending on if the particle is registered |
Example:
particles:isPresent("minecraft:smoke")