Skip to content

Instantly share code, notes, and snippets.

@corarona
Created January 11, 2022 01:30
Show Gist options
  • Save corarona/18e524e5eef1a5261fb325214c757b10 to your computer and use it in GitHub Desktop.
Save corarona/18e524e5eef1a5261fb325214c757b10 to your computer and use it in GitHub Desktop.
replace_locked_chests
minetest.register_lbm({
label = "Replace locked chests with normal ones",
name = "replace_locked_chests:lbm",
nodenames = {"default:chest_locked"},
run_at_every_load = true,
action = function(pos, node)
local m=minetest.get_meta(pos):to_table()
local p1=node.param1
local p2=node.param2
m.fields={}
minetest.set_node(pos,{name="default:chest",param1=p1,param2=p2})
minetest.get_meta(pos):from_table(m)
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment