6

I'm asking this for a minigame I'm making. The egg should spawn a chick when broken, every time, as opposed to the 1/8 chance the egg normally has of producing a chick.

I don't want to have to create any mods or plugins for this either. Perhaps my first question should be, "Is it even possible?"

2
  • 2
    There is sadly no way to do this directly via NBT data, but you could try using a modified version of my answer to a related question. The positioning is not quite exact, and you'll probably end up with 9/8 chicken/egg thrown, however.
    – MrLemon
    Commented Oct 26, 2015 at 17:30
  • You could just make a resource pack and replace the snowball texture with the egg texture and just give the player snowballs instead of eggs.
    – Mystery
    Commented Oct 26, 2015 at 20:58

1 Answer 1

1

Use an armor stand to follow the egg and summon chicks when the armor stand loses the snowball.

Setup:

/scoreboard objectives add Stand dummy
/scoreboard objectives add hasStand dummy
/scoreboard objectives add hasEgg dummy

Clock:

/scoreboard players set @e[type=ArmorStand] Stand 1 {Marker:1,Invisible:1,NoGravity:1}
/execute @e[type=ThrownEgg,score_hasStand_min=1] ~ ~ ~ tp @e[type=ArmorStand,score_Stand_min=1,c=1] @e[type=ThrownEgg,score_hasStand_min=1,c=1,r=1]
/scoreboard players set @e[type=ThrownEgg] hasStand 0
/scoreboard players set @e[type=ArmorStand,score_Stand_min=1] hasEgg 0
/execute @e[type=ArmorStand,score_Stand_min=1] ~ ~ ~ scoreboard players set @e[type=ThrownEgg,r=1,c=1] hasStand 1
/execute @e[type=ThrownEgg,r=1,c=1] ~ ~ ~ scoreboard players set @e[type=ArmorStand,score_Stand_min=1] hasEgg 1
/execute @e[type=ThrownEgg,score_hasStand=0] ~ ~ ~ summon ArmorStand ~ ~ ~ {Marker:1,Invisible:1,NoGravity:1}
/scoreboard players @e[type=ThrownEgg] hasStand 1
/execute @e[type=ArmorStand,score_Stand_min=1,score_hasEgg=0] ~ ~ ~ summon Chicken ~ ~ ~ {Age:-400}
/kill @e[type=ArmorStand,score_Stand_min=1,score_hasEgg=0]
1
  • Thanks for the help! For whatever reason, I though I would have to edit the egg's NBT, but this method is much simpler. Commented Oct 27, 2015 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.