summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/util.lua b/util.lua
index df2adf7..93e89df 100644
--- a/util.lua
+++ b/util.lua
@@ -429,4 +429,19 @@ digtron.update_builder_item = function(pos)
digtron.create_builder_item = item_stack:get_name()
minetest.add_entity(pos,"digtron:builder_item")
end
-end \ No newline at end of file
+end
+
+digtron.damage_creatures = function(player, pos, amount)
+ local objects = minetest.env:get_objects_inside_radius(pos, 1.0)
+ if objects ~= nil then
+ for _, obj in ipairs(objects) do
+ if obj then
+ obj:punch(player, 1.0, {
+ full_punch_interval = 1.0,
+ damage_groups = {fleshy = amount},
+ }, nil )
+ end
+ end
+ end
+end
+ \ No newline at end of file