execute if entity @a[nbt={active_effects:[{id:"minecraft:poison"}]}] run tellraw @s [{"text": "[Holy Milk Bucket] ","color": "#fffebb"},{"text":"Cleansed of ","color": "gray"},{"text":"💀 Poison","color": "green"},{"text":" effect!","color": "gray"}]
execute if entity @a[nbt={active_effects:[{id:"minecraft:poison"}]}] at @s run playsound minecraft:entity.cow.death player @s ~ ~ ~ 0.25 2
execute if entity @a[nbt={active_effects:[{id:"minecraft:poison"}]}] at @s run playsound block.bell.resonate player @s ~ ~ ~ 0.75 2
execute if entity @a[nbt={active_effects:[{id:"minecraft:poison"}]}] run tag @s add holy_milk_bucket_effect_clear_poison
execute if entity @a[nbt={active_effects:[{id:"minecraft:poison"}]}] at @s run particle minecraft:dust_plume ~ ~1 ~ 0.2 0.5 0.2 0.1 25
effect clear @s[tag=holy_milk_bucket_effect_clear_poison] poison

execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] if entity @a[nbt={active_effects:[{id:"minecraft:wither"}]}] run tellraw @s [{"text": "[Holy Milk Bucket] ","color": "#fffebb"},{"text":"Cleansed of ","color": "gray"},{"text":"💔 Wither","color": "dark_gray"},{"text":" effect!","color": "gray"}]
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] if entity @a[nbt={active_effects:[{id:"minecraft:wither"}]}] at @s run playsound minecraft:entity.cow.death player @s ~ ~ ~ 0.25 2
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] if entity @a[nbt={active_effects:[{id:"minecraft:wither"}]}] at @s run playsound block.bell.resonate player @s ~ ~ ~ 0.75 2
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] if entity @a[nbt={active_effects:[{id:"minecraft:wither"}]}] run tag @s add holy_milk_bucket_effect_clear_wither
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] if entity @a[nbt={active_effects:[{id:"minecraft:wither"}]}] at @s run particle minecraft:dust_plume ~ ~1 ~ 0.2 0.5 0.2 0.1 25
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] run effect clear @s[tag=holy_milk_bucket_effect_clear_wither] wither

execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] if entity @a[nbt={active_effects:[{id:"minecraft:slowness"}]}] run tellraw @s [{"text": "[Holy Milk Bucket] ","color": "#fffebb"},{"text":"Cleansed of ","color": "gray"},{"text":"🐌 Slowness","color": "dark_blue"},{"text":" effect!","color": "gray"}]
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] if entity @a[nbt={active_effects:[{id:"minecraft:slowness"}]}] at @s run playsound minecraft:entity.cow.death player @s ~ ~ ~ 0.25 2
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] if entity @a[nbt={active_effects:[{id:"minecraft:slowness"}]}] at @s run playsound block.bell.resonate player @s ~ ~ ~ 0.75 2
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] if entity @a[nbt={active_effects:[{id:"minecraft:slowness"}]}] run tag @s add holy_milk_bucket_effect_clear_slowness
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] if entity @a[nbt={active_effects:[{id:"minecraft:slowness"}]}] at @s run particle minecraft:dust_plume ~ ~1 ~ 0.2 0.5 0.2 0.1 25
execute unless entity @s[tag=holy_milk_bucket_effect_clear_poison] unless entity @s[tag=holy_milk_bucket_effect_clear_wither] run effect clear @s[tag=holy_milk_bucket_effect_clear_slowness] slowness

tag @s remove holy_milk_bucket_effect_clear_poison
tag @s remove holy_milk_bucket_effect_clear_wither
tag @s remove holy_milk_bucket_effect_clear_slowness