Skip to content

Instantly share code, notes, and snippets.

@cornernote
Created October 3, 2012 03:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cornernote/3824737 to your computer and use it in GitHub Desktop.
Save cornernote/3824737 to your computer and use it in GitHub Desktop.
build bedrock under player
local bedrock_timer = 1
minetest.register_globalstep(function(dtime)
bedrock_timer = bedrock_timer - dtime
if bedrock_timer > 0 then return end
for k,player in ipairs(minetest.get_connected_players()) do
bedrock_timer = 1
local pos = player:getpos()
if pos.y < -1 then
player:setpos({x=pos.x,y=3,z=pos.z})
end
if (pos.y<2) then
if minetest.env:get_node({x=pos.x,y=-1,z=pos.z}).name == "air" then
for x=-2,2 do
for z=-2,2 do
minetest.env:set_node({x=pos.x+x,y=-1,z=pos.z+z}, {name="super_flat:bedrock"})
end
end
end
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment