## Convert to sunken drowned
execute if entity @s[tag=vb.convert_to.sunken] run return run function vb:load_entity/convert_to/sunken

## Spawn sunken drowned
# Get values
execute store result score @s vb.dummy1 run data get entity @s Pos[1]
execute store result score @s vb.dummy2 run random value 1..3
# Spawn
execute if score @s vb.dummy1 matches ..45 if score @s vb.dummy2 matches ..2 run function vb:summon/sunken {motion:'[0,0,0]'}
execute if score @s vb.dummy1 matches ..45 if score @s vb.dummy2 matches ..2 run function vb:load_entity/kill

## Make this a true drowned (it can drop drowned souls)
tag @s add vb.true_mob.drowned

## Equip Coral Blade
execute store result score #VB vb.dummy1 run random value 1..50
execute if score #VB vb.dummy1 matches 1 run loot replace entity @s weapon.mainhand loot vb:items/brain_coral_blade
execute if score #VB vb.dummy1 matches 2 run loot replace entity @s weapon.mainhand loot vb:items/tube_coral_blade
execute if score #VB vb.dummy1 matches 3 run loot replace entity @s weapon.mainhand loot vb:items/horn_coral_blade
execute if score #VB vb.dummy1 matches 4 run loot replace entity @s weapon.mainhand loot vb:items/fire_coral_blade
execute if score #VB vb.dummy1 matches 5 run loot replace entity @s weapon.mainhand loot vb:items/bubble_coral_blade
