summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-09-20 20:06:53 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-09-20 20:06:53 +0100
commit84672a07ce69c5474a240beb98a1a82685897205 (patch)
tree277b9002b67533adfe2c23f7db672606d5f5c7fe
parentf1a30679aaa136cfdb7431cab628f2b428dc9de5 (diff)
knockback can also use 'knockback' value inside tool groups if found
-rw-r--r--api.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index b95b6d2..f98f6b9 100644
--- a/api.lua
+++ b/api.lua
@@ -1,9 +1,9 @@
--- Mobs Api (17th September 2017)
+-- Mobs Api (20th September 2017)
mobs = {}
mobs.mod = "redo"
-mobs.version = "20170917"
+mobs.version = "20170920"
-- Intllib
@@ -2249,13 +2249,20 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
-- direction error check
dir = dir or {x = 0, y = 0, z = 0}
+ -- check if tool already has specific knockback value
+ if tool_capabilities.damage_groups["knockback"] then
+ kb = tool_capabilities.damage_groups["knockback"]
+ else
+ kb = kb * 2
+ end
+
self.object:setvelocity({
x = dir.x * kb,
y = up,
z = dir.z * kb
})
- self.pause_timer = r
+ self.pause_timer = 0.25 -- r
end
end -- END if damage