diff --git a/mods/ITEMS/mcl_campfires/api.lua b/mods/ITEMS/mcl_campfires/api.lua index 4136b4df7..5b1669b33 100644 --- a/mods/ITEMS/mcl_campfires/api.lua +++ b/mods/ITEMS/mcl_campfires/api.lua @@ -108,8 +108,12 @@ function mcl_campfires.cook_item(pos, elapsed) if entites then for _, entity in ipairs(entites) do if entity then - if entity:get_luaentity().name == "mcl_campfires:food_entity" then - food_entity = entity + luaentity = entity:get_luaentity() + if luaentity then + name = luaentity.name + if name == "mcl_campfires:food_entity" then + food_entity = entity + end end end end