Cuberite Forum

Full Version: Entity.Destroy() crash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For whatever reason, When I use this function cuberite crashes:

[Image: SmvQwhz.png]

Cuberite crashes on launch. I thought this would be a simple task... Any help would be greatly appreciated!  Huh

EDIT:
I fixed it by calling HOOK_SPAWNING_ENTITY instead of HOOK_SPAWNED_ENTITY and doing this:
[Image: SSfWNtW.png]

But there's still no merit for a crash from the former method.
True, Cuberite should not crash. But your code is very flawed. Note that all the Lua API functions use the "object" calling convention in Lua, which means you need to use colons instead of dots: Entity:IsExpOrb(); Entity:Destroy()
Perhaps it crashes because the entity is not added to the world yet while cEntity:Destroy() tries to remove it?