From 989cf849eb51cab5894d64a695327c3e9bc7ecf5 Mon Sep 17 00:00:00 2001 From: aimlol Date: Sun, 14 Jul 2013 10:50:36 +0400 Subject: [PATCH] Cactus is harmful --- mods/default/init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/default/init.lua b/mods/default/init.lua index ff1bb2a..0636548 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -346,6 +346,18 @@ minetest.register_abm({ end }) +minetest.register_abm({ + nodenames = {"default:cactus"}, + interval = 0.5, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + players = minetest.env:get_objects_inside_radius(pos, 1) + for i, player in ipairs(players) do + player:set_hp(player:get_hp() - 1) + end + end, +}) + minetest.register_node("default:papyrus", { description = "Papyrus", drawtype = "plantlike",