import*as mc from"@minecraft/server";import*as selectors from"../utils/selectors";import*as umvuthana from"./umvuthana";export function eventBehavior(t){umvuthana.eventBehavior(t),"hit"!==t.eventId?"counter"!==t.eventId||mc.system.runTimeout((()=>{if(!t.entity.isValid())return;const e=t.entity.location;t.entity.applyImpulse(t.entity.getViewDirection()),mc.system.runTimeout((()=>{if(!t.entity.isValid())return;const n=t.entity.dimension.getEntities({location:e,maxDistance:8,families:["player"]});void 0!==n[0]&&(n[0].applyDamage(7,{cause:"entityAttack",damagingEntity:t.entity}),n[0].applyKnockback(e.x,e.z,2.5,.1))}),4)}),7):t.entity.runCommand("/playsound random.anvil_land @a[r=16] ~~~ 1 2")}export function tick5(t){t.getProperty("hf_mzs:block_counter")>0&&t.setProperty("hf_mzs:block_counter",t.getProperty("hf_mzs:block_counter")-1),t.runCommand("/execute as @s at @s rotated ~ 0 positioned ^^^5 if entity @p[r=5] run event entity @s player_infront"),t.runCommand("/execute as @s at @s rotated ~ 0 positioned ^^^5 unless entity @p[r=5] run event entity @s no_player_infront")}