/** * destroys a minion at the end of their dying animation this implies that setting their animation * to die will destroy them. */ @ReceiveEvent(components = {SkeletalMeshComponent.class, AnimationComponent.class}) public void onAnimationEnd(AnimEndEvent event, EntityRef entity) { AnimationComponent animcomp = entity.getComponent(AnimationComponent.class); if (animcomp != null && event.getAnimation().equals(animcomp.dieAnim)) { entity.destroy(); } }