diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index 86fc9663..d0525d60 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1126,7 +1126,7 @@ end on_punch = function(self, hitter, tflp, tool_capabilities, dir) -- weapon wear local weapon = hitter:get_wielded_item() - if weapon:get_definition().tool_capabilities ~= nil then + if weapon:get_definition().tool_capabilities ~= nil and weapon:get_definition().tool_capabilities.full_punch_interval ~= nil then local wear = ( weapon:get_definition().tool_capabilities.full_punch_interval / 75 ) * 9000 weapon:add_wear(wear) hitter:set_wielded_item(weapon)