This is how I did it in Voxelgarden. Essentially it's just a smaller collision box, so you can stand "inside" the node, but with an smaller node box so it doesn't look strange.
Code: Select all
minetest.register_node("default:cactus", {
description = "Cactus",
drawtype = "nodebox",
paramtype = "light",
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
groups = {snappy=1, choppy=3, flammable=2},
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.5, -0.375, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.375, 0.5, 0.5},
{-0.5, -0.5, 0.375, 0.5, 0.5, 0.375},
{-0.5, -0.5, -0.375, 0.5, 0.5, -0.375},
{-0.375, -0.5, -0.375, 0.375, 0.5, 0.375},
}
},
selection_box = {
type = "fixed",
fixed = {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}
},
collision_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875},
}
},
damage_per_second = 1,
sounds = default.node_sound_wood_defaults(),
after_dig_node = function(pos, node, metadata, digger)
default.dig_up(pos, node, digger)
default.dig_up(pos, {name = "default:cactus_fig"}, digger)
end,
})