scoreboard objectives add phantom_cultist_end_crystal_timer dummy
scoreboard objectives add phantom_cultist_text_display_show dummy

tp @s ~ ~ ~ facing entity @p eyes

summon end_crystal ~ ~2.5 ~ {ShowBottom:0b,Tags:["phantom_cultist_crystal_init","phantom_cultist_crystal"]}
execute as @e[type=end_crystal,limit=1,sort=nearest] run scoreboard players add @s phantom_cultist_text_display_show 15
tag @e[type=end_crystal,tag=phantom_cultist_crystal_init,limit=1,sort=nearest] remove phantom_cultist_crystal_init

summon text_display ~ ~2.5 ~ {billboard:"center",teleport_duration:1,alignment:"center",Tags:["phantom_cultist_end_crystal"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,2f,0f],scale:[1.5f,1.5f,1.5f]},text:'[{"bold":true,"color":"red","italic":false,"text":"["},{"bold":true,"color":"green","italic":false,"score":{"name":"@e[type=end_crystal,tag=phantom_cultist_crystal,limit=1,sort=nearest]","objective":"phantom_cultist_text_display_show"}},{"bold":true,"color":"red","italic":false,"text":"]"}]'}

ride @e[type=end_crystal,tag=phantom_cultist_crystal,limit=1,sort=nearest] mount @e[type=text_display,tag=phantom_cultist_end_crystal,limit=1,sort=nearest]

particle end_rod ~ ~2.5 ~ 0.5 0.5 0.5 0.5 45
playsound minecraft:block.respawn_anchor.charge hostile @a[distance=..80] ~ ~ ~ 3 1
execute as @e[type=text_display,tag=phantom_cultist_end_crystal,limit=1,sort=nearest] run scoreboard players add @s phantom_cultist_end_crystal_timer 300