tag @s add polyd
tag @s add special
scoreboard players set @s polytimer 120
execute at @s[tag=polyd] run summon sheep ~ ~ ~ {Tags:[poly_sheep,special],Health:6f,DeathLootTable:"",attributes:[{type:"movement_speed",base:0.3f},{Name:"max_health",base:6f}],CustomName:{"text":"Polymorphed Player"},drop_chances:{head:0f,chest:0f,legs:0f,feet:0f}}
summon minecraft:text_display ~ ~ ~ {Tags:[polyname]}
data modify entity @n[tag=polyname] text set value {"selector": "@p"}
data modify entity @n[tag=poly_sheep] CustomName set from entity @n[tag=polyname] text
data modify entity @n[tag=poly_sheep] CustomNameVisible set value 1b
kill @e[tag=polyname]

item replace entity @n[tag=poly_sheep] armor.head from entity @s armor.head
item replace entity @n[tag=poly_sheep] armor.chest from entity @s armor.chest
item replace entity @n[tag=poly_sheep] armor.legs from entity @s armor.legs
item replace entity @n[tag=poly_sheep] armor.feet from entity @s armor.feet

data modify entity @n[tag=poly_sheep] Rotation set from entity @s Rotation
data modify entity @n[tag=poly_sheep] Fire set from entity @s Fire
data modify entity @n[tag=poly_sheep] Motion set from entity @s Motion
data modify entity @n[tag=poly_sheep] active_effects set from entity @s active_effects
gamemode spectator
spectate @n[tag=poly_sheep]
damage @n[tag=poly_sheep] .0001 minecraft:player_attack by @s from @s

particle dust{color:[1,0.33,1],scale:3} ~ ~.5 ~ .3 .4 .3 0 20
playsound minecraft:entity.puffer_fish.blow_up player @a ~ ~ ~ 2 1.5
title @s actionbar {"color":"light_purple","text":"Polymorphed!"}