# ==================================================
# void vb.volley.ball()
# ==================================================

scoreboard players set vb.volley.ball.__hasFunctionReturned__ tbms.var 0
execute as @e[type=sl:marker,r=1.1] run tp @s ^ ^ ^10
execute if score vb.volley.timeInvisible tbms.var matches 2.. run function vb/zzz_sl_block/66
execute if score vb.volley.smashing tbms.var matches 0 if score vb.volley.trailTime tbms.var matches 1.. run function vb/volley/trailing
execute unless score vb.volley.smashing tbms.var matches 0 run function vb/volley/trailing2
tp @e[type=zedafox:ball_trail2] ~ ~ ~
scoreboard players set vb.volley.ball._0._5 tbms.var 0
execute if entity @e[tag=player,r=3] if block ~ 47 ~ concrete 4 run function vb/zzz_sl_block/67
execute if score vb.volley.ball._0._5 tbms.var matches 0 run replaceitem entity @s slot.armor.head 0 air
execute if score vb.volley.direction tbms.var matches 0 run function vb/zzz_sl_block/71
execute if score vb.volley.direction tbms.var matches 1 run function vb/zzz_sl_block/73
scoreboard players operation vb.volley.ball._0._13 tbms.var = @s vb.volley.offset
execute if score vb.volley.ball._0._13 tbms.var matches 1 run tp @s ~ ~ ~0.05
execute if score vb.volley.ball._0._13 tbms.var matches 2 run tp @s ~ ~ ~0.1
execute if score vb.volley.ball._0._13 tbms.var matches 3 run tp @s ~ ~ ~-0.05
execute if score vb.volley.ball._0._13 tbms.var matches 4 run tp @s ~ ~ ~-0.1
execute unless score vb.volley.direction tbms.var matches -1 run scoreboard players add @s vb.volley.time 1
execute if score @s vb.volley.time matches 81.. run function vb/zzz_sl_block/74
scoreboard players set vb.volley.ball._0._16 tbms.var 0
execute if score vb.volley.failure tbms.var matches 0 if block ~ 31 ~ concrete 14 if score @s vb.volley.time matches 36.. if score vb.volley.smashing tbms.var matches 0 run function vb/zzz_sl_block/76
execute if score vb.volley.failure tbms.var matches 0 if block ~ 31 ~ concrete 14 if score @s vb.volley.time matches 19.. unless score vb.volley.smashing tbms.var matches 0 if score vb.volley.ball._0._16 tbms.var matches 0 run function vb/zzz_sl_block/78
execute if entity @e[type=zedafox:helicotnt,r=1.5] run function vb/volley/foul_tnt
execute if entity @e[type=zedafox:hoop,r=2] if score vb.volley.direction tbms.var matches 0 as @e[type=zedafox:hoop,c=1] run function vb/hoop/taken
