summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-01-12 19:18:48 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2018-01-12 19:18:48 +0000
commit4bf4d42b07940f77f7333d94d3c0fcf93e5e5511 (patch)
treeb4b8bca16c762ca509bc6657cd330b2fdaf267f8 /api.lua
parent5751d98ab0c4e184099dc9da49100b78f0c616b7 (diff)
added multiple blood textures
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index f9a4e08..3c4db20 100644
--- a/api.lua
+++ b/api.lua
@@ -2225,7 +2225,15 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
pos.y = pos.y + (-self.collisionbox[2] + self.collisionbox[5]) * .5
- effect(pos, self.blood_amount, self.blood_texture, nil, nil, 1, nil)
+ -- do we have a single blood texture or multiple?
+ if type(self.blood_texture) == "table" then
+
+ local blood = self.blood_texture[random(1, #self.blood_texture)]
+
+ effect(pos, self.blood_amount, blood, nil, nil, 1, nil)
+ else
+ effect(pos, self.blood_amount, self.blood_texture, nil, nil, 1, nil)
+ end
end
-- do damage