# Remove any shield not in the offhand
execute store result score #tmp stats_calc run clear @s shield{simple_shield:1} 0
execute if score #tmp stats_calc matches 2.. run clear @s shield{simple_shield:1}
execute if predicate items:in_inventory/custom_shield unless predicate items:offhand/custom_shield run clear @s shield{simple_shield:1}

# offhand full with not the shield
execute if predicate items:offhand/filled unless predicate items:offhand/custom_shield run tellraw @s ["",{"text":"[!] ","color":"red","bold":true},{"translate":"msg.shield_slot","color":"gray","bold":false}]

# offhand empty
execute unless predicate items:offhand/filled run function items:stats_calc/shield/update

kill @e[nbt={Item:{tag:{simple_shield:1}}}]
