Skip to content

Instantly share code, notes, and snippets.

@GreenXenith GreenXenith/init.lua Secret
Created Nov 15, 2017

Embed
What would you like to do?
local second = tonumber(os.date("%S"))
local minute = tonumber(os.date("%M"))
--Inside the node
on_construct = function(pos, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
if second > 10 then
meta:set_int("next_min", minute + 1)
minetest.log("none", "second is " ..second.. " which is greater than 10, setting fill date to next minute (" .. minute + 1 ..") from current minute (" .. minute .. ")")
elseif second <= 10 then
meta:set_int("next_min", minute)
minetest.log("none", "second is " ..second.. " which is less than 10, setting fill date to current minute (" .. minute ..")")
end
end,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.