Added custom on_step for mob arrows (thx npxcoot)
parent
4ad941523e
commit
0e4ba14bc1
2
api.lua
2
api.lua
|
@ -2473,7 +2473,7 @@ function mobs:register_arrow(name, def)
|
||||||
switch = 0,
|
switch = 0,
|
||||||
arrow = true,
|
arrow = true,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = def.on_step or function(self, dtime)
|
||||||
|
|
||||||
self.timer = self.timer + 1
|
self.timer = self.timer + 1
|
||||||
|
|
||||||
|
|
1
api.txt
1
api.txt
|
@ -170,6 +170,7 @@ This function registers a arrow for mobs with the attack type shoot.
|
||||||
the parameters are (self, pos, node)
|
the parameters are (self, pos, node)
|
||||||
'tail' when set to 1 adds a trail or tail to mob arrows
|
'tail' when set to 1 adds a trail or tail to mob arrows
|
||||||
'tail_texture' texture string used for above effect
|
'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)
|
mobs:register_egg(name, description, background, addegg)
|
||||||
|
|
Loading…
Reference in New Issue