- Code: Select all
WATERPARTICLES = {
physical = true,
collisionbox = {0,0,0,0,0,0},
visual = "sprite",
visual_size = {x=0.2, y=0.2},
textures = {"default_water.png"},
on_activate = function (self)
self.object:setvelocity({x=math.random(-1,1)*0.5, y=math.random(-1,1)*0.5, z=math.random(-1,1)*0.5})
end,
on_step = function(self, dtime)
self.timer = self.timer + dtime
if self.timer > 20 then
self.object:remove()
end
if minetest.env:get_node(self.object:getpos()).name ~= "default:water_source" then
self.object:remove()
end
end,
timer = 0,
}
minetest.register_entity("particles:water", WATERPARTICLES)
minetest.register_abm({
nodenames = {"default:water_source"},--, "default:water_flowing"},
interval = 10,
chance = 1,
action = function(pos)
if math.random(1000) == 1 then
minetest.env:add_entity({x=pos.x+math.random()*0.5,y=pos.y-0.25,z=pos.z+math.random()*0.5}, "particles:water")
end
end,
})
This code adds floating particles in water. What about adding this to V 0.2 of this mod? (Maybe with another texture for the particles)