I'm trying to create a skript that will "eggify" sheep when they are clicked with a stick, and respawn them when the egg is used, with the same color they were before getting eggified. I have yet to remove the initial entity, but that's not the problem I cannot seem to fix. What is is the fact that the sheep doesn't spawn as the stored color. I might just be stupid, but I do need help.
I am not getting any errors, and it's otherwise working perfectly.
I have the following installed relating to skript:
Skript
Skellett
SkBee
SkQuery
Code:
on right click on sheep:
if held item of player is stick:
set {_color} to color of event-entity
send action bar "<lime>You just eggified that poor <gold>Sheep<lime>!" to player
give player 1 of sheep spawn egg named "&fSheep Spawn Egg %{_color}%"
on right click holding a sheep spawn egg:
if name of player's tool contains "&fSheep Spawn Egg":
cancel event
set {_name} to name of player's tool
replace all "&fSheep Spawn Egg " in {_name} with ""
set {_color} to {_name}
remove 1 sheep spawn egg named "&fSheep Spawn Egg %{_color}%" from player's inventory
spawn sheep at clicked block
set color of last spawned sheep to {_color}
send "Spawned a %{_color}% sheep!" to player