injures you when digging

master
Neuromancer56 2016-01-09 16:34:33 -06:00
parent 3955770f3f
commit d6b6bcaf3b
1 changed files with 13 additions and 1 deletions

View File

@ -14,6 +14,9 @@ minetest.register_node("crystalhearts:crystalheart", {
sunlight_propagates = true,
sounds = default.node_sound_glass_defaults(),
groups = {cracky=3,oddly_breakable_by_hand=3},
on_punch = function(pos, node, puncher)
reduce_hp(puncher)
end
})
minetest.register_ore({
@ -25,4 +28,13 @@ minetest.register_ore({
clust_size = 3,
height_min = -31000,
height_max = -200,
})
})
function reduce_hp(player)
hp = player:get_hp()
--hp = math.floor(hp+0.5)
hp= hp-1
player:set_hp(tonumber(hp))
end
print("Crystal Hearts Mod Loaded!")