forked from mtcontrib/mobs_redo
added player check for protected hits
This commit is contained in:
parent
b71369f487
commit
053866c05b
2
api.lua
2
api.lua
|
@ -1849,7 +1849,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
|
||||
-- is mob protected?
|
||||
if self.protected
|
||||
if self.protected and hitter:is_player()
|
||||
and minetest.is_protected(self.object:getpos(), hitter:get_player_name()) then
|
||||
minetest.chat_send_player(hitter:get_player_name(), "Mob has been protected!")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user