From 0e4ba14bc16a2799ff67cdaabe7d7a3003d28cc5 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 6 May 2016 11:38:43 +0100 Subject: [PATCH] Added custom on_step for mob arrows (thx npxcoot) --- api.lua | 2 +- api.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 8917418..6f6a7ff 100644 --- a/api.lua +++ b/api.lua @@ -2473,7 +2473,7 @@ function mobs:register_arrow(name, def) switch = 0, arrow = true, - on_step = function(self, dtime) + on_step = def.on_step or function(self, dtime) self.timer = self.timer + 1 diff --git a/api.txt b/api.txt index 95bb397..93c4500 100644 --- a/api.txt +++ b/api.txt @@ -170,6 +170,7 @@ This function registers a arrow for mobs with the attack type shoot. the parameters are (self, pos, node) 'tail' when set to 1 adds a trail or tail to mob arrows 'tail_texture' texture string used for above effect + 'on_step' is a custom function when arrow is active, nil for default. mobs:register_egg(name, description, background, addegg)