using .exists() for entities
@ReceiveEvent
public void beforeDestroy(BeforeDestroyEvent event, EntityRef entity, CharacterComponent character) {
- if (character.controller != EntityRef.NULL) {
+ if (character.controller.exists()) {
// Consume the BeforeDestroyEvent so that the DoDestroy event is never sent
event.consume();
}
