package Remove import Entity import Assets import BuilderConstants function onRemoveObject() let id = GetSpellAbilityId() if id == REMOVE_OBJECT_ID let u = GetSpellAbilityUnit() let data = u.getEntity() if data != null and not data.done flashEffect(Abilities.aIamTarget, u.getPos()) data.terminate() u..removeAbility(REMOVE_OBJECT_ID) init EventListener.add(EVENT_PLAYER_UNIT_SPELL_EFFECT, () -> onRemoveObject())