## Save NBT
data modify storage vb:dummy mob_nbt_transfer.CustomName set from entity @s CustomName
data modify storage vb:dummy mob_nbt_transfer.Health set from entity @s Health

## Summon new mob
$summon $(mob) ~ ~ ~ {Tags:["vb.loaded","vb.new_summon"]}
data modify entity @n[tag=vb.new_summon] CustomName set from storage vb:dummy mob_nbt_transfer.CustomName
data modify entity @n[tag=vb.new_summon] Health set from storage vb:dummy mob_nbt_transfer.Health

## Clear saved storage & kill
tag @n[tag=vb.new_summon] remove vb.new_summon
data remove storage vb:dummy mob_nbt_transfer
function vb:load_entity/kill
