I received the following error message from the server. Apparently the sheep was eating a node that got unloaded before this line of code. One needs to check if the function returns nil and take appropriate action before using the nil return value.
ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'sheep' in callback luaentity_Step(): ...table-0.4/bin/../mods/mob-engine/creatures/functions.lua:522: attempt to index local 'n' (a nil value)
local n = core.get_node_or_nil(self.eat_node)
local nnn = n.name
...
I received the following error message from the server. Apparently the sheep was eating a node that got unloaded before this line of code. One needs to check if the function returns nil and take appropriate action before using the nil return value.
ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'sheep' in callback luaentity_Step(): ...table-0.4/bin/../mods/mob-engine/creatures/functions.lua:522: attempt to index local 'n' (a nil value)