minetest.add_particle

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

minetest.add_particle(particle_definition)

Description

Spawns a particle at the specified position. If you want to spawn multiple particles, use minetest.add_particlespawner.

Parameters

1: Table containing 8/9 items:

pos vector starting position of the particle
velocity vector particle velocity
acceleration vector particle acceleration
expirationtime number particle disappears after <expirationtime> seconds
size number particle size in meters
collisiondetection boolean true if should collide with solid nodes, false if not
collision_removal boolean If it's set to true, particles are removed when colliding (requires collisiondetection).
vertical boolean limit to vertical axis (useful for rain)
glow number specify particle self-luminescence in darkness (optional)
texture string particle texture
animation Tile Animation definition specifies how to animate the particle texture (optional)
playername optional string If specified, the particle is only spawned for the player with this name.

Example

minetest.add_particle({
	pos = {x=0, y=0, z=0},
	velocity = {x=0, y=0, z=0},
	acceleration = {x=0, y=0, z=0},
	expirationtime = 1,
	size = 1,
	collisiondetection = false,
	vertical = false,
	texture = "default_wood.png",
	playername = "singleplayer"
})
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox