对应函数为: function EntityScript:CollectActions(type, ...) local t = COMPONENT_ACTIONS[type] if t ~= nil then for i, v in ipairs(self.actioncomponents) do local collector = t[ACTION_COMPONENT_NAMES[v]] if collector ~= nil then collector(self, ...) end end if self.modactioncomponents ~= nil then --print("EntityScript:CollectActions on ", self) for modname,modtable in pairs(self.modactioncomponents) do --print("modname ",modname, #modtable) if MOD_COMPONENT_ACTIONS[modname] == nil then print( "ERROR: Mod component actions are out of sync for mod " .. (modname or "unknown") .. ". This is likely a result of your mod's calls to AddComponentAction not happening on both the server and the client." ) print( "self.modactioncomponents is\n" .. (dumptable(self.modactioncomponents) or "") ) print( "MOD_COMPONENT_ACTIONS is\n" .. (dumptable(MOD_COMPONENT_ACTIONS) or "") ) end t = MOD_COMPONENT_ACTIONS[modname][type] <<< 这行挂掉的 if t ~= nil then for i, v in ipairs(modtable) do local collector = t[MOD_ACTION_COMPONENT_NAMES[modname][v]] if collector ~= nil then collector(self, ...) end end end end end else print("Type ",type," doesn't exist in the table of component actions. Is your component name correct in AddComponentAction?") end end 所以,请收集你的LOG文件,最后结尾处会有类似: ERROR: Mod component actions are out of sync for mod XXXX . This is likely a result of your mod's calls to AddComponentAction not happening on both the server and the client. self.modactioncomponents is ... MOD_COMPONENT_ACTIONS is... 类似的内容,其中XXXX就是出错的MOD。如果此MOD有新版则更新至新版,如果没有禁用就好了。