Команда на выдачу указки:
give @p minecraft:debug_stick{pointer:1b,display:{Name:'{"text":"Указка","italic":false}'}}
Цикл:
1. kill @e[type=minecraft:text_display,tag=target]
2. execute as @a[nbt={SelectedItem:{tag:{pointer:1b}}}] at @s anchored eyes run summon minecraft:text_display ^ ^ ^4 {view_range:100f,billboard:"center",see_through:1b,Tags:["target"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,-1f,0f],scale:[7f,7f,7f]},text:'{"text":"X","color":"#FF0000","bold":true}',background:-16777216}