mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2024-12-22 17:00:26 +01:00
add _is_arrow=true to throwable egg
This commit is contained in:
parent
54f6de148b
commit
cd2b2609a2
@ -138,7 +138,7 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = function(self, player)
|
||||||
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
player:punch(self.object, 1.0, {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups = {fleshy = 1},
|
damage_groups = {fleshy = 1},
|
||||||
}, nil)
|
}, nil)
|
||||||
@ -213,6 +213,7 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
|
|||||||
|
|
||||||
ent.velocity = egg_VELOCITY -- needed for api internal timing
|
ent.velocity = egg_VELOCITY -- needed for api internal timing
|
||||||
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
||||||
|
ent._is_arrow = true -- tell advanced mob protection this is an arrow
|
||||||
|
|
||||||
obj:setvelocity({
|
obj:setvelocity({
|
||||||
x = dir.x * egg_VELOCITY,
|
x = dir.x * egg_VELOCITY,
|
||||||
|
Loading…
Reference in New Issue
Block a user