scoreboard players set @s KyuDummy 3
scoreboard players set @s KyuDummy2 0
scoreboard players operation @s KyuDummy2 = @s PotSlotKyu
scoreboard players operation @s KyuDummy2 %= @s KyuDummy

#execute at @s[scores={KyuDummy2=0}] positioned ^ ^ ^.2 run execute positioned ~ ~ ~ run execute positioned ~ ~.65 ~ run summon armor_stand ~ ~ ~ {Small:1b,Invisible:1,NoGravity:1b,Tags:["PotionMover","NormalPot"],Passengers:[{id:"minecraft:potion",NoGravity:1,Tags:["TurnToPotion"],Item:{id:"minecraft:potion",Count:1b},Age:1999s}],NoGravity:1}
#execute at @s[scores={KyuDummy2=0}] positioned ^ ^ ^.2 run execute positioned ~ ~ ~ run execute positioned ~ ~.65 ~ run summon armor_stand ~ ~ ~ {Small:1b,Invisible:1,NoGravity:1b,Tags:["PotionMover","NormalPot"],Passengers:[{id:"minecraft:potion",NoGravity:1,Tags:["TurnToPotion"],Item:{id:"minecraft:potion",Count:1b},Age:1999s}],NoGravity:1}
#execute at @s[scores={KyuDummy2=1}] positioned ^ ^ ^.2 run execute positioned ~ ~ ~ run execute positioned ~ ~.65 ~ run summon armor_stand ~ ~ ~ {Small:1b,Invisible:1,NoGravity:1b,Tags:["PotionMover","SplashPot"],Passengers:[{id:"minecraft:potion",NoGravity:1,Tags:["TurnToPotion"],Item:{id:"minecraft:splash_potion",Count:1b},Age:1999s}],NoGravity:1}
#execute at @s[scores={KyuDummy2=2}] positioned ^ ^ ^.2 run execute positioned ~ ~ ~ run execute positioned ~ ~.65 ~ run summon armor_stand ~ ~ ~ {Small:1b,Invisible:1,NoGravity:1b,Tags:["PotionMover","LingPot"],Passengers:[{id:"minecraft:potion",NoGravity:1,Tags:["TurnToPotion"],Item:{id:"minecraft:lingering_potion",Count:1b},Age:1999s}],NoGravity:1}

execute at @s positioned ^ ^ ^.2 run execute positioned ~ ~ ~ run execute positioned ~ ~.65 ~ run summon armor_stand ~ ~ ~ {Small:1b,Invisible:1,NoGravity:1b,Tags:["PotionMover"],Passengers:[{id:"minecraft:potion",NoGravity:1,Tags:["TurnToPotion"],Item:{id:"minecraft:structure_void",Count:2b},Age:1999s}],NoGravity:1}

loot give @p loot minecraft:junkfill

execute at @s[scores={PotSlotKyu=3..5}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[0]
execute at @s[scores={PotSlotKyu=6..8}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[1]
execute at @s[scores={PotSlotKyu=9..11}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[2]
execute at @s[scores={PotSlotKyu=12..14}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[3]
execute at @s[scores={PotSlotKyu=15..17}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[4]
execute at @s[scores={PotSlotKyu=18..20}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[5]
execute at @s[scores={PotSlotKyu=21..23}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[6]
execute at @s[scores={PotSlotKyu=24..26}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[7]
execute at @s[scores={PotSlotKyu=27..29}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[8]
execute at @s[scores={PotSlotKyu=30..32}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[9]
execute at @s[scores={PotSlotKyu=33..35}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[10]
execute at @s[scores={PotSlotKyu=36..38}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[11]
execute at @s[scores={PotSlotKyu=39..41}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[12]
execute at @s[scores={PotSlotKyu=42..44}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[13]
execute at @s[scores={PotSlotKyu=45..47}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[14]
execute at @s[scores={PotSlotKyu=48..50}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[15]
execute at @s[scores={PotSlotKyu=51..53}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[16]
execute at @s[scores={PotSlotKyu=54..56}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[17]
execute at @s[scores={PotSlotKyu=57..59}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[18]
execute at @s[scores={PotSlotKyu=60..62}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[19]
execute at @s[scores={PotSlotKyu=63..65}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[20]
execute at @s[scores={PotSlotKyu=66..68}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[21]
execute at @s[scores={PotSlotKyu=69..71}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[22]
execute at @s[scores={PotSlotKyu=72..74}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[23]
execute at @s[scores={PotSlotKyu=75..77}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[24]
execute at @s[scores={PotSlotKyu=78..80}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[25]
execute at @s[scores={PotSlotKyu=81..83}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[26]
execute at @s[scores={PotSlotKyu=84..86}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[27]
execute at @s[scores={PotSlotKyu=87..89}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[28]
execute at @s[scores={PotSlotKyu=90..92}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[29]
execute at @s[scores={PotSlotKyu=93..95}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[30]
execute at @s[scores={PotSlotKyu=96..98}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[31]
execute at @s[scores={PotSlotKyu=99..101}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[32]
execute at @s[scores={PotSlotKyu=102..104}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[33]
execute at @s[scores={PotSlotKyu=105..107}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[34]
execute at @s[scores={PotSlotKyu=108..110}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[35]
execute at @s[scores={PotSlotKyu=111..113}] positioned ~ ~ ~ run data modify entity @e[distance=..11,type=potion,limit=1,sort=nearest,tag=TurnToPotion] Item set from entity @s Inventory[36]

execute at @s positioned ^ ^ ^.2 run execute positioned ~ ~.65 ~ run execute positioned ~ ~ ~ run tp @e[type=armor_stand,distance=..1.5,tag=PotionMover,limit=1] ~ ~ ~ ~ ~
execute in overworld run data merge block 999998 121 999979 {auto:1b}
scoreboard players add @e[type=armor_stand,tag=PotionMover,limit=1] PotionCbowTim 0

#execute at @s positioned ~ ~255 ~ run summon arrow ^ ^ ^1 {Motion:[0.0,0.0,0.0],Tags:["TNTArrow"]}
#execute as @e[type=arrow,tag=TNTArrow,tag=!GotMotion] run execute at @s positioned ~ ~-500 ~ run data modify entity @s Motion[0] set from entity @e[limit=1,type=arrow,sort=nearest] Motion[0]
#execute as @e[type=potion,tag=TurnToPotion,tag=!GotMotion] run execute at @s positioned ~ ~-255 ~ run tp @s @e[limit=1,sort=nearest,type=arrow,distance=..1,nbt={life:0s}]
#execute as @e[type=potion,tag=TurnToPotion,tag=!GotMotion] run execute at @s positioned ~ ~-255 ~ run execute store result entity @s Motion[0] double .00005 run data get entity @e[limit=1,type=arrow,sort=nearest,distance=..1] Motion[0] 10000
#execute as @e[type=potion,tag=TurnToPotion,tag=!GotMotion] run execute at @s positioned ~ ~-255 ~ run execute store result entity @s Motion[1] double .00005 run data get entity @e[limit=1,type=arrow,sort=nearest,distance=..1] Motion[1] 10000
#execute as @e[type=potion,tag=TurnToPotion,tag=!GotMotion] run execute at @s positioned ~ ~-255 ~ run execute store result entity @s Motion[2] double .00005 run data get entity @e[limit=1,type=arrow,sort=nearest,distance=..1] Motion[2] 10000
kill @e[type=arrow,distance=..3]
#execute at @s positioned ~ ~1.25 ~ run summon silverfish ^ ^ ^1 {Attributes:[{Name:generic.follow_range,Base:0}],Silent:1b,ActiveEffects:[{Id:11b,Amplifier:6b,Duration:111111111,ShowParticles:0b},{Id:14b,Amplifier:1b,Duration:111111111,ShowParticles:0b}],Small:1b,Passengers:[{id:"minecraft:tnt",Fuse:60}],Invulnerable:1b,Motion:[0.0,0.0,0.0],Tags:["tpme2","TNTArrowSt"]}
tag @e[type=potion,tag=TurnToPotion,tag=!GotMotion] add GotMotion
#summon armor_stand ~ ~1.25 ~ {Invulnerable:1b,Motion:[0.0,0.0,0.0],Tags:["tpme2","TNTArrowSt"],ActiveEffects:[{Id:28b,Amplifier:11b,Duration:11111111}]}
#execute at @s positioned ~ ~1 ~ run tp @e[type=silverfish,distance=..3] ^ ^1 ^5.3






############################this hurts me deep in my bones but it's the easiest way to do it while ignoring certain potions...
execute as @s[scores={PotSlotKyu=3..5}] run item replace entity @s container.0 with air
execute as @s[scores={PotSlotKyu=6..8}] run item replace entity @s container.1 with air
execute as @s[scores={PotSlotKyu=9..11}] run item replace entity @s container.2 with air
execute as @s[scores={PotSlotKyu=12..14}] run item replace entity @s container.3 with air
execute as @s[scores={PotSlotKyu=15..17}] run item replace entity @s container.4 with air
execute as @s[scores={PotSlotKyu=18..20}] run item replace entity @s container.5 with air
execute as @s[scores={PotSlotKyu=21..23}] run item replace entity @s container.6 with air
execute as @s[scores={PotSlotKyu=24..26}] run item replace entity @s container.7 with air
execute as @s[scores={PotSlotKyu=27..29}] run item replace entity @s container.8 with air
execute as @s[scores={PotSlotKyu=30..32}] run item replace entity @s container.9 with air
execute as @s[scores={PotSlotKyu=33..35}] run item replace entity @s container.10 with air
execute as @s[scores={PotSlotKyu=36..38}] run item replace entity @s container.11 with air
execute as @s[scores={PotSlotKyu=39..41}] run item replace entity @s container.12 with air
execute as @s[scores={PotSlotKyu=42..44}] run item replace entity @s container.13 with air
execute as @s[scores={PotSlotKyu=45..47}] run item replace entity @s container.14 with air
execute as @s[scores={PotSlotKyu=48..50}] run item replace entity @s container.15 with air
execute as @s[scores={PotSlotKyu=51..53}] run item replace entity @s container.16 with air
execute as @s[scores={PotSlotKyu=54..56}] run item replace entity @s container.17 with air
execute as @s[scores={PotSlotKyu=57..59}] run item replace entity @s container.18 with air
execute as @s[scores={PotSlotKyu=60..62}] run item replace entity @s container.19 with air
execute as @s[scores={PotSlotKyu=63..65}] run item replace entity @s container.20 with air
execute as @s[scores={PotSlotKyu=66..68}] run item replace entity @s container.21 with air
execute as @s[scores={PotSlotKyu=69..71}] run item replace entity @s container.22 with air
execute as @s[scores={PotSlotKyu=72..74}] run item replace entity @s container.23 with air
execute as @s[scores={PotSlotKyu=75..77}] run item replace entity @s container.24 with air
execute as @s[scores={PotSlotKyu=78..80}] run item replace entity @s container.25 with air
execute as @s[scores={PotSlotKyu=81..83}] run item replace entity @s container.26 with air
execute as @s[scores={PotSlotKyu=84..86}] run item replace entity @s container.27 with air
execute as @s[scores={PotSlotKyu=87..89}] run item replace entity @s container.28 with air
execute as @s[scores={PotSlotKyu=90..92}] run item replace entity @s container.29 with air
execute as @s[scores={PotSlotKyu=93..95}] run item replace entity @s container.30 with air
execute as @s[scores={PotSlotKyu=96..98}] run item replace entity @s container.31 with air
execute as @s[scores={PotSlotKyu=99..101}] run item replace entity @s container.32 with air
execute as @s[scores={PotSlotKyu=102..104}] run item replace entity @s container.33 with air
execute as @s[scores={PotSlotKyu=105..107}] run item replace entity @s container.34 with air
execute as @s[scores={PotSlotKyu=108..110}] run item replace entity @s container.35 with air
execute as @s[scores={PotSlotKyu=111..113}] run item replace entity @s container.36 with air






#clear @s[scores={KyuDummy2=0}] potion 1
#clear @s[scores={KyuDummy2=1}] splash_potion 1
#clear @s[scores={KyuDummy2=2}] lingering_potion 1
clear @s shield{clearme:1b}

execute at @s run tp @e[tag=TurnToPotion] ~ ~5 ~

scoreboard players set @s PotSlotKyu -1
scoreboard players set @s KyuDummy 0
scoreboard players set @s KyuDummy2 0
