#=== Reset player if exit the boat ===#
scoreboard players tag @e[tag=InBoat] add ResetInBoat {OnGround:1b}
scoreboard players reset @e[tag=ResetInBoat] InBoat
scoreboard players tag @e[tag=ResetInBoat] remove InBoat
scoreboard players tag @e[tag=ResetInBoat] remove ResetInBoat

#=== Exit boat if murder at 2 block (player) ===#
execute @e[tag=Murder] ~ ~ ~ execute @a[r=2,tag=Innocent] ~ ~ ~ tp @s[tag=InBoat] ~ ~ ~

#=== Detect if a player is in the boat ===#
scoreboard players tag @e[type=boat,tag=BoatRunning,name=BoatRun] add TestForPlayerInBoat
execute @a[tag=InBoat] ~ ~ ~ scoreboard players tag @e[r=5,c=1,type=boat,tag=TestForPlayerInBoat] remove TestForPlayerInBoat

#=== Exit boat if murder at 2 block (villager) ===#
execute @e[tag=Murder] ~ ~ ~ execute @e[r=2,tag=Innocent,type=villager] ~ ~ ~ scoreboard players tag @e[type=boat,tag=BoatRunning,name=BoatRun] add TestForPlayerInBoat

#=== Reset at the end of the run ===#
execute @e[name=ArmorRun,score_BoatRun_min=100] ~ ~ ~ scoreboard players tag @e[r=1,type=boat,tag=BoatRunning,name=BoatRun] add TestForPlayerInBoat

#=== Main Reset ===#
execute @e[type=boat,tag=TestForPlayerInBoat,name=BoatRun] ~ ~ ~ kill @e[type=armor_stand,name=ArmorRun,r=2]
execute @e[type=boat,tag=TestForPlayerInBoat,name=BoatRun] ~ ~ ~ kill @e[type=area_effect_cloud,name=BoatPassenger,r=2]
kill @e[type=boat,tag=TestForPlayerInBoat,name=BoatRun]