![Post Post](./styles/mt_v1/imageset/icon_post_target.gif)
trap door mod
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node("blocks:trap_door", {
drawtype = "nodebox",
tiles = {"default_stone.png"},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
light_source = 20,
walkable = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
},
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
},
groups = {cracky=3},
description="trap door",
on_punch = function(pos,node)
minetest.env:add_node(pos, {name="blocks:trap_door1"})
end,
})
minetest.register_node("blocks:trap_door1", {
drawtype = "nodebox",
tiles = {"default_stone.png"},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
light_source = 20,
walkable = true,
selection_box = {
type = "fixed",
fixed = {0.4, -0.5, -0.5, 0.5, 0.5, 0.5}
},
node_box = {
type = "fixed",
fixed = {0.4, -0.5, -0.5, 0.5, 0.5, 0.5}
},
groups = {cracky=3},
description="trap door",
on_punch = function(pos,node)
minetest.env:add_node(pos, {name="blocks:trap_door"})
end,
})