tag @s add mega_zombie_snowball
data merge entity @s {Item:{id:"minecraft:zombie_spawn_egg",count:1}}
tag @s add temp
execute on origin if entity @s[team=red] as @n[type=snowball,tag=temp] run tag @s add red
execute on origin if entity @s[team=blue] as @n[type=snowball,tag=temp] run tag @s add blue
tag @s remove temp