tag @e[tag=r_ok] remove r_ok
#1号車ポイント通過左モード
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^ ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^ ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^1 ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^-1 ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-1 ^-1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^ ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^ ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^1 ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^-1 ^15 rail -1 function hl
execute @e[tag=c1,tag=pt_l] ~~~ detect ^-2 ^-1 ^15 golden_rail -1 function hl
#
#1号車ポイント通過右モード
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^ ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^ ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^1 ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^-1 ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^1 ^-1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^ ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^ ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^1 ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^-1 ^15 rail -1 function hr
execute @e[tag=c1,tag=pt_r] ~~~ detect ^2 ^-1 ^15 golden_rail -1 function hr
#
#1号車中心検知
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^ ^15 rail -1 tag @s add r_ok
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^ ^15 golden_rail -1 tag @s add r_ok
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^1 ^15 rail -1 tag @s add r_ok
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^1 ^15 golden_rail -1 tag @s add r_ok
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^-1 ^15 rail -1 tag @s add r_ok
execute @e[tag=c1,tag=!r_ok] ~~~ detect ^ ^-1 ^15 golden_rail -1 tag @s add r_ok
#
#1号車左検知
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^ ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^ ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^1 ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^-1 ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-1 ^-1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^ ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^ ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^1 ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^1 ^15 golden_rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^-1 ^15 rail -1 function hl
execute @e[tag=c1,tag=!r_ok,tag=!pt_l] ~~~ detect ^-2 ^-1 ^15 golden_rail -1 function hl
#
#1号車右検知
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^ ^15 rail -1 say r1
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^ ^15 golden_rail -1 say r1
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^ ^15 rail -1 say r2
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^ ^15 golden_rail -1 say r2

execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^ ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^ ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^1 ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^-1 ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^1 ^-1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^ ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^ ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^1 ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^1 ^15 golden_rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^-1 ^15 rail -1 function hr
execute @e[tag=c1,tag=!r_ok,tag=!pt_r] ~~~ detect ^2 ^-1 ^15 golden_rail -1 function hr
#
#回転
execute @e[tag=r_ok] ~~~ say r
