How to spawn a chicken that lays diamonds?
There is no simple command to do this, but I have found a way to replace eggs that were just laid by a chicken with a diamond.
This makes use of the chicken's EggLayTime
data tag, to mark chickens which are about to lay an egg. Unfortunately, this tag never actually reaches 0, it resets immediately. So, marking them 1 tick before will have to suffice. Create a scoreboard objective for the chickens:
/scoreboard objectives add eggLayer dummy
Now set up a repeat/chain command block line, and put in the following commands:
/scoreboard players remove @e[type=Chicken,score_eggLayer_min=1] eggLayer 1
/scoreboard players set @e[type=Chicken] eggLayer 2 {EggLayTime:1}
/execute @e[type=Chicken,score_eggLayer=1,score_eggLayer_min=1] ~ ~ ~ /scoreboard players tag @e[type=Item,c=1,r=1] add laidEgg {Item:{id:minecraft:egg}}
/entitydata @e[type=Item,tag=laidEgg] {Item:{id:minecraft:diamond},Tags:[]}
Chickens that will lay an egg in 1 tick get an eggLayer
score of 2, which automatically decreased by 1 per tick until it reaches 0 again. 1 tick later, when the egg is actually laid, it is marked with a tag and transformed into a diamond using /entitydata
.