add _is_arrow=true to throwable egg

This commit is contained in:
tenplus1 2021-04-06 13:07:55 +01:00
parent 54f6de148b
commit cd2b2609a2
1 changed files with 2 additions and 1 deletions

View File

@ -138,7 +138,7 @@ mobs:register_arrow("mobs_animal:egg_entity", {
end,
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,
damage_groups = {fleshy = 1},
}, nil)
@ -213,6 +213,7 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
ent.velocity = egg_VELOCITY -- needed for api internal timing
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({
x = dir.x * egg_VELOCITY,