diff --git a/realisticcactus/init.lua b/realisticcactus/init.lua new file mode 100644 index 0000000..da261db --- /dev/null +++ b/realisticcactus/init.lua @@ -0,0 +1,16 @@ +minetest.register_abm({ + label = "Cactus damage", + nodenames = {"default:cactus"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local objs = minetest.get_objects_inside_radius(pos, 1.5) + for _, obj in ipairs(objs) do + if obj:is_player() then + minetest.log("action", "[cactus_mod] Player taking damage from cactus.") + obj:set_hp(obj:get_hp() - 1) + end + end + end, +}) + diff --git a/realisticcactus/mod.conf b/realisticcactus/mod.conf new file mode 100644 index 0000000..df4e603 --- /dev/null +++ b/realisticcactus/mod.conf @@ -0,0 +1,4 @@ +author = Themostrandom01 +name = realisticcactus +description = add real cactus +Title = Real Cactus diff --git a/realisticcactus/screenshot.png b/realisticcactus/screenshot.png new file mode 100644 index 0000000..41865ec Binary files /dev/null and b/realisticcactus/screenshot.png differ