# Initiate
advancement revoke @s only sanguine:technical/player_killed_entity/sanguine_chalice_kill
data remove storage sanguine:storage root.temp
scoreboard players reset #chalice_temp sanguine.dummy
scoreboard players reset @s sanguine.dummy

# Set Slot
execute if data entity @s Inventory[{Slot:-106b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 106
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:0b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 0
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:1b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 1
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:2b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 2
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:3b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 3
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:4b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 4
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:5b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 5
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:6b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 6
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:7b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 7
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:8b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 8
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:9b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 9
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:10b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 10
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:11b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 11
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:12b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 12
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:13b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 13
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:14b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 14
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:15b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 15
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:16b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 16
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:17b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 17
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:18b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 18
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:19b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 19
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:20b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 20
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:21b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 21
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:22b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 22
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:23b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 23
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:24b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 24
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:25b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 25
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:26b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 26
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:27b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 27
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:28b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 28
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:29b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 29
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:30b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 30
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:31b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 31
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:32b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 32
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:33b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 33
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:34b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 34
execute unless score @s sanguine.dummy = @s sanguine.dummy if data entity @s Inventory[{Slot:35b,tag:{sanguine:{id:"sanguine_chalice",chalice_toggle:0}}}] run scoreboard players set @s sanguine.dummy 35

# Confirm Slot
execute if score @s sanguine.dummy matches 106 run function sanguine:item/sanguine_chalice/slot/offhand
execute if score @s sanguine.dummy matches 0 run function sanguine:item/sanguine_chalice/slot/0
execute if score @s sanguine.dummy matches 1 run function sanguine:item/sanguine_chalice/slot/1
execute if score @s sanguine.dummy matches 2 run function sanguine:item/sanguine_chalice/slot/2
execute if score @s sanguine.dummy matches 3 run function sanguine:item/sanguine_chalice/slot/3
execute if score @s sanguine.dummy matches 4 run function sanguine:item/sanguine_chalice/slot/4
execute if score @s sanguine.dummy matches 5 run function sanguine:item/sanguine_chalice/slot/5
execute if score @s sanguine.dummy matches 6 run function sanguine:item/sanguine_chalice/slot/6
execute if score @s sanguine.dummy matches 7 run function sanguine:item/sanguine_chalice/slot/7
execute if score @s sanguine.dummy matches 8 run function sanguine:item/sanguine_chalice/slot/8
execute if score @s sanguine.dummy matches 9 run function sanguine:item/sanguine_chalice/slot/9
execute if score @s sanguine.dummy matches 10 run function sanguine:item/sanguine_chalice/slot/10
execute if score @s sanguine.dummy matches 11 run function sanguine:item/sanguine_chalice/slot/11
execute if score @s sanguine.dummy matches 12 run function sanguine:item/sanguine_chalice/slot/12
execute if score @s sanguine.dummy matches 13 run function sanguine:item/sanguine_chalice/slot/13
execute if score @s sanguine.dummy matches 14 run function sanguine:item/sanguine_chalice/slot/14
execute if score @s sanguine.dummy matches 15 run function sanguine:item/sanguine_chalice/slot/15
execute if score @s sanguine.dummy matches 16 run function sanguine:item/sanguine_chalice/slot/16
execute if score @s sanguine.dummy matches 17 run function sanguine:item/sanguine_chalice/slot/17
execute if score @s sanguine.dummy matches 18 run function sanguine:item/sanguine_chalice/slot/18
execute if score @s sanguine.dummy matches 19 run function sanguine:item/sanguine_chalice/slot/19
execute if score @s sanguine.dummy matches 20 run function sanguine:item/sanguine_chalice/slot/20
execute if score @s sanguine.dummy matches 21 run function sanguine:item/sanguine_chalice/slot/21
execute if score @s sanguine.dummy matches 22 run function sanguine:item/sanguine_chalice/slot/22
execute if score @s sanguine.dummy matches 23 run function sanguine:item/sanguine_chalice/slot/23
execute if score @s sanguine.dummy matches 24 run function sanguine:item/sanguine_chalice/slot/24
execute if score @s sanguine.dummy matches 25 run function sanguine:item/sanguine_chalice/slot/25
execute if score @s sanguine.dummy matches 26 run function sanguine:item/sanguine_chalice/slot/26
execute if score @s sanguine.dummy matches 27 run function sanguine:item/sanguine_chalice/slot/27
execute if score @s sanguine.dummy matches 28 run function sanguine:item/sanguine_chalice/slot/28
execute if score @s sanguine.dummy matches 29 run function sanguine:item/sanguine_chalice/slot/29
execute if score @s sanguine.dummy matches 30 run function sanguine:item/sanguine_chalice/slot/30
execute if score @s sanguine.dummy matches 31 run function sanguine:item/sanguine_chalice/slot/31
execute if score @s sanguine.dummy matches 32 run function sanguine:item/sanguine_chalice/slot/32
execute if score @s sanguine.dummy matches 33 run function sanguine:item/sanguine_chalice/slot/33
execute if score @s sanguine.dummy matches 34 run function sanguine:item/sanguine_chalice/slot/34
execute if score @s sanguine.dummy matches 35 run function sanguine:item/sanguine_chalice/slot/35

# Audio
execute if score #chalice_temp sanguine.dummy matches 1..10 run playsound sanguine:item.sanguine_chalice.fill player @s
execute if score #chalice_temp sanguine.dummy matches 11 run playsound sanguine:item.sanguine_chalice.full player @s
