## Get UUIDs
function vb:tick_player/custom_item/animal_whistle/get_uuid {from:UUID}
execute as @e[type=wolf,distance=..26] run function vb:tick_player/custom_item/animal_whistle/get_uuid {from:Owner}

## Sound
$execute if score @s vb.tick_data.sneak matches 1.. run playsound vb:item.animal_whistle player @a[distance=..$(range)] ~ ~ ~ 5 0.8
$execute if score @s vb.tick_data.sneak matches ..0 run playsound vb:item.animal_whistle player @a[distance=..$(range)] ~ ~ ~ 5 1

## Target correct wolves
$execute if score @s vb.tick_data.sneak matches 1.. as @e[type=wolf,distance=..$(range)] if score @s vb.dummy1 = @p vb.dummy1 if score @s vb.dummy2 = @p vb.dummy2 if score @s vb.dummy3 = @p vb.dummy3 if score @s vb.dummy4 = @p vb.dummy4 run function vb:tick_player/custom_item/animal_whistle/wolf_action {sit:1}
$execute if score @s vb.tick_data.sneak matches ..0 as @e[type=wolf,distance=..$(range)] if score @s vb.dummy1 = @p vb.dummy1 if score @s vb.dummy2 = @p vb.dummy2 if score @s vb.dummy3 = @p vb.dummy3 if score @s vb.dummy4 = @p vb.dummy4 run function vb:tick_player/custom_item/animal_whistle/wolf_action {sit:0}
$execute at @e[type=wolf,distance=..$(range)] run tp @n[type=wolf] ~ ~ ~ facing entity @s