04-23-2015, 02:40 PM 
		
	
	(04-23-2015, 08:53 AM)xoft Wrote: What kind of mob? I guess there's a mismatch between the mob's class and the Lua API class used. We don't export explicit mob classes, such as "cCreeper", but perhaps the code is trying to push such a class to Lua, which I know causes crashes.
I don't do any cast here. Here is a test plugin. If it's running right-click an entity and the server will crash.
function Initialize(Plugin)
    Plugin:SetName("TestPlugin")
    Plugin:SetVersion(1)
    
    -- Hook
    cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY, OnPlayerRightClickingEntity);
    
    LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    return true
end
function OnPlayerRightClickingEntity(Player, Entity)
    local world = cRoot:Get():GetDefaultWorld()
    world:DoWithEntityByID(
        Entity:GetUniqueID(),
        function(Entity)
            
        end
    )
end
	
 

 


