import*as mc from"@minecraft/server";import*as selectors from"../utils/selectors";import{EXCLUDED_ENTITIES}from"../playerAbilities";const DAMAGE=3,RANGE=2,FIRE_TIME=2;export function eventBehavior(e){"minecraft:entity_spawned"===e.eventId&&e.entity.runCommand("/playsound hf_mzs:misc.sunstrike @a[r=16] ~~~ 1 1"),"damage"===e.eventId&&(e.entity.runCommand("/camerashake add @a[r=4] 1 0.3 positional"),selectors.union({location:e.entity.location,maxDistance:2,excludeFamilies:["inanimate"],excludeTypes:EXCLUDED_ENTITIES},[],e.entity.dimension,e.entity.getDynamicProperty("hf_mzs:caster_id")).forEach((t=>{if(void 0===t||!t.isValid())return;const a=mc.world.getEntity(e.entity.getDynamicProperty("hf_mzs:caster_id"));t.typeId.includes("umvuthana")&&(t.getProperty("hf_mzs:tamed")&&t.getComponent("tameable").tamedToPlayer.id===a.id||!t.getProperty("hf_mzs:tamed")&&"hf_mzs:umvuthi"===a.typeId)||(t.applyKnockback(1,0,1,.4),t.applyDamage(3,{cause:"entityAttack"}),t.setOnFire(2))})))}