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

# slot full
execute if predicate items:8th/filled unless predicate items:8th/map run tellraw @s ["",{"text":"[!] ","color":"red","bold":true},{"translate":"msg.map_slot","color":"gray","bold":false}]

# Slot empty
execute unless predicate items:8th/filled run function items:stats_calc/map/update

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