## Runs when the mob comes in contact with it - used for moving a mob into place
## Runs from controller.animation.ender_target.reached
## @s = ldz:ender_target

difficulty normal

#execute as @s[family=ender_hydro_target_3] run effect @e[type=ldz:ender_hydro] levitation 2 1 true
execute as @s[family=ender_hydro_target_3] run event entity @e[type=ldz:ender_hydro] set_levitator_to_true
execute as @s[family=ender_hydro_target_4] run event entity @e[type=ldz:ender_hydro] set_levitator_to_false
execute as @s[family=ender_hydro_target_4] run event entity @e[type=ldz:teleport_pad,family=wraith_pad_dungeon] set_powered_to_true
execute as @s[family=ender_hydro_target_5] at @e[type=ldz:ender_hydro] run particle ldz:vanilla_teleport ~ ~1 ~
execute as @s[family=ender_hydro_target_5] at @e[type=ldz:ender_hydro] run playsound ui.teleport.out @a ~ ~ ~ 5
execute as @s[family=ender_hydro_target_5] run event entity @e[type=ldz:ender_hydro] despawn

## SPAWN NEW TRADE VERSION
execute as @s[family=ender_hydro_target_5] run scoreboard objectives remove PHydro
execute as @s[family=ender_hydro_target_5] run scoreboard objectives add PHydro dummy
execute as @s[family=ender_hydro_target_5] run summon ldz:ender_hydro ~ ~20 ~ 0 0 add_trader
execute as @s[family=ender_hydro_target_5] run event entity @e[type=ldz:ender_hydro] add_duplication_check_toggle
execute as @s[family=ender_hydro_target_5] run scoreboard players add @e[type=ldz:ender_hydro,family=ender_trader,c=1] PHydro 1
execute as @s[family=ender_hydro_target_5] run teleport @e[type=ldz:ender_hydro] 134 157 27


execute as @a[tag=dev] run say ender hydro reached target
event entity @s despawn