Certain falling nodes should cause damage to the player. This mod adds that important functionality. Though it only adds for certain nodes. I ask that it be allowed to be used for adding fall damage to any node other modders would like to add.
Edit: Based on TenPlus1's comment adding the following code to your mod will allow you to add fall damage to any node:
local function add_fall_damage(node, damage)
local function add_fall_damage(node, damage)
if minetest.registered_nodes[node] then
local group = minetest.registered_nodes[node].groups
group.falling_node_damage = damage
minetest.override_item(node, {groups = group})
else
print (node .. " not found to add falling_node_damage to")
end
end
add_fall_damage("my_mod:my_node", 3)
@Neuromancer - All the local function does is add a group to each node {falling_node_damage=2} for damage levels, this can be added directly to the node itself without using the function.
Certain falling nodes should cause damage to the player. This mod adds that important functionality. Though it only adds for certain nodes. I ask that it be allowed to be used for adding fall damage to any node other modders would like to add.
Edit: Based on TenPlus1's comment adding the following code to your mod will allow you to add fall damage to any node: local function add_fall_damage(node, damage)
@Neuromancer - All the local function does is add a group to each node {falling_node_damage=2} for damage levels, this can be added directly to the node itself without using the function.
Thanks! Updated my comment.