/scoreboard objectives add item dummy
adds a scoreboard called item
/scoreboard players set @e[type=Item] item 1 {Item:{id:"minecraft:egg",Count:1b,Damage:0s}}
Sets to 1 the score of all the eggs (id:"minecraft:egg"), with the count of 1 and 0 data
/scoreboard players set @e[type=Item] item 2 {Item:{id:"minecraft:gunpowder",Count:4b,Damage:0s}}
Does the same of the first, but with a four-counted item (Count:4b)
/scoreboard players set @e[type=Item] item 3 {Item:{id:"minecraft:coal",Count:1b,Damage:1s,tag:{display:{Name:"creeper's coal"}}}}
The same of the first, but with a 1-data item and also a renamed item, so you know how to insert tags.
You can use an infinite number of items
/scoreboard players set @e[type=Item] item 4 {Item:{id:"minecraft:spawn_egg",Count:1b,Damage:0s,tag:{EntityTag:{id:Creeper}}}}
The same of the first, but with a creeper egg
/execute @e[type=Item,score_item_min=3,score_item=3] ~ ~ ~ execute @e[type=Item,score_item_min=2,score_item=2,r=1] ~ ~ ~ entitydata @e[type=Item,score_item_min=1,score_item=1,r=1] {Item:{id:"minecraft:spawn_egg",Count:1b,Damage:0s,tag:{EntityTag:{id:Creeper}}}}
Executes an item with the score settled at 3 execute an item in the range of a block and with the score at 2 change the data of an item with the score at 1 in the range of a block.
You can type all the times you want the execute @e[type=Item,score_item_min=n,score_item=n] ~ ~ ~ string
/execute @e[type=Item,score_item_min=4,score_item=4] ~ ~ ~ kill @e[type=Item,score_item_min=2,score_item=2,r=1]
executes all the creeper eggs (score at 4) kill all the items with the score setted at 2
/execute @e[type=Item,score_item_min=4,score_item=4] ~ ~ ~ kill @e[type=Item,score_item_min=3,score_item=3,r=1]
The same of the previous, but with an item with the score setted at 3
/execute @e[type=Item,score_item_min=4,score_item=4] ~ ~ ~ summon FireworksRocketEntity ~ ~ ~ {LifeTime:0,Motion:[0.00,0.00,0.00],FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Explosions:[{Type:0,Flicker:0,Trail:0,Colors:[4871935],FadeColors:[16777215]},{Type:0,Flicker:0,Trail:0,Colors:[16755530],FadeColors:[16777215]},{Type:0,Flicker:0,Trail:0,Colors:[16775508],FadeColors:[16777215]}]}}}}
Execute all the creeper's eggs summon a firework that explodes at the moment