## Check if we've already used an item
execute if score @s vb.tick_data.custom_item_rc matches 1.. run scoreboard players set @s vb.tick_data.right_click 0
execute if score @s vb.tick_data.right_click matches 1.. run scoreboard players set @s vb.tick_data.custom_item_rc 1

## Damage item
execute if score @s vb.tick_data.right_click matches 1.. if items entity @s weapon.mainhand *[custom_data~{vb.item.spanner:1b}] run item modify entity @s weapon.mainhand {function:"minecraft:set_damage",damage:-0.011,add:1}
execute if score @s vb.tick_data.right_click matches 1.. unless items entity @s weapon.mainhand *[custom_data~{vb.item.spanner:1b}] run item modify entity @s weapon.offhand {function:"minecraft:set_damage",damage:-0.011,add:1}

## Raycast
execute if score @s vb.tick_data.right_click matches 1.. run scoreboard players set @s vb.raycast 20
execute if score @s vb.tick_data.right_click matches 1.. anchored eyes positioned ^ ^ ^0.25 unless score #VB vb.settings.disable_things_that_grief matches 1 run function vb:tick_player/custom_item/spanner/raycast