# 추격자 태그 설정
tag @a[tag=!hunter] remove hunter
tag @a[tag=!runner] remove runner
# 초기 추격자 설정 (첫 번째 플레이어)
tag @p[limit=1] add hunter
tag @a[tag=!hunter] add runner
# 스코어보드 설정
scoreboard objectives add diamond_count dummy "Diamonds Used"
scoreboard objectives add cooldown dummy "Cooldown Timer"
# 메인 틱 함수
function manhunt_diamond_tracker:setup
# 추격자만 F키 입력 감지
execute as @a[tag=hunter] if predicate manhunt_diamond_tracker:is_hunter run function manhunt_diamond_tracker:track
# 쿨다운 감소
execute as @a[tag=hunter,scores={cooldown=1..}] run scoreboard players remove @s cooldown 1
# F키 입력 확인 및 쿨다운 체크
execute if entity @s[scores={cooldown=0}] if entity @s[nbt={SelectedItem:{id:"minecraft:diamond"}}] run function manhunt_diamond_tracker:execute_track
# 쿨다운이 남아있거나 다이아몬드를 들고 있지 않을 때 메시지 표시
execute unless entity @s[scores={cooldown=0}] unless entity @s[nbt={SelectedItem:{id:"minecraft:diamond"}}] run tellraw @s {"text":"다이아몬드를 들고 F키를 누르세요!","color":"red"}
# 다이아몬드 소모
clear @s diamond 1
# 쿨다운 설정 (10초)
scoreboard players set @s cooldown 200
# 도망자 찾기
execute as @a[tag=runner,limit=1] store result score @s temp_x run data get entity @s Pos[0] 1000
execute as @a[tag=runner,limit=1] store result score @s temp_y run data get entity @s Pos[1] 1000
execute as @a[tag=runner,limit=1] store result score @s temp_z run data get entity @s Pos[2] 1000
# 파티클 생성 (추격자 위치에서 도망자 방향으로)
execute at @s run particle minecraft:dragon_breath ~ ~ ~ 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^1 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^2 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^3 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^4 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^5 0.1 0.1 0.1 0.01 100
# 파티클이 도망자 방향으로 이동하도록 설정
execute at @s run particle minecraft:dragon_breath ^ ^ ^6 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^7 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^8 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^9 0.1 0.1 0.1 0.01 100
execute at @s run particle minecraft:dragon_breath ^ ^ ^10 0.1 0.1 0.1 0.01 100
# 사용 횟수 증가
scoreboard players add @s diamond_count 1
# 메시지 표시
tellraw @s {"text":"도망자를 향해 다이아몬드 추적기를 발사했습니다!","color":"green"}