#Eggify Function Help

1 messages · Page 1 of 1 (latest)

gloomy spire
#

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

#

Please ping me if you respond as I have a lot of servers and can be hard to keep up with everything

limber lotus
#

It's just setting the color to a string, I'd guess

fierce imp
#

i dont think this requires skellet or skquery, and skquery is known for breaking things

fierce imp
#

i think you can just store the nbt of the (clicked) sheep, then apply it to the spawned sheep too

gloomy spire
fierce imp
#

you'd need skbee, then i assume you might be able to just tranfer the compound from a sheep to the item, then back to a sheep maybe

#

although i'd check and see what the full nbt compound of the sheep is

#

might be easier to just take a tag