How do I add a particle spawner to appear when placing nodes? I want it to be the same for all nodes.
Also, where are the current dig particle spawner located in code? I can't find it.
[Solved] Spawn particles on place of any node
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
[Solved] Spawn particles on place of any node
Last edited by texmex on Thu Jul 26, 2018 18:18, edited 1 time in total.
- AspireMint
- Member
- Posts: 415
- Joined: Mon Jul 09, 2012 12:59
- GitHub: AspireMint
- IRC: AspireMint
- In-game: AspireMint
- Location: Stuck at spawn
Re: Spawn particles on place of any node
old thread, but for anyone who still dont know:
example:
https://dev.minetest.net/minetest.register_on_placenode
https://dev.minetest.net/minetest.add_particlespawner
Code: Select all
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
minetest.add_particlespawner({
...
})
end)
Code: Select all
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
minetest.add_particlespawner({
amount = 20,
time = 1,
minpos = pos,
maxpos = pos,
minvel = {x=1, y=0.5, z=-1},
maxvel = {x=-1, y=5, z=1},
minacc = {x=1, y=1, z=-1},
maxacc = {x=-1, y=5, z=1},
minexptime = 0.5,
maxexptime = 1,
minsize = 1,
maxsize = 10,
collisiondetection = false,
vertical = false,
texture = "image.png",
playername = placer:get_player_name() -- only show to placer
})
end)
https://dev.minetest.net/minetest.add_particlespawner
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: Spawn particles on place of any node
Ah, of course! Thank you, AspireMint.
Who is online
Users browsing this forum: No registered users and 3 guests