Thanks for the code. It's the most helpful.
I have an idea.
ex:
Create a ItemTool. Fill these code in to it.
You can drop a item:
if (!par2World.isRemote)
{
EntityItem entityitem = new EntityItem(par2World, (float)par4, (float) par5, (float) par6, new ItemStack(Block.mobSpawner.blockID,1, 0));
//par2World, par4, par5, par6 is the parameter of onBlockDestroyed. par3 is the blockId which block has been destroyed.
//Your code can get metadata of the mobSpawner.
entityitem.delayBeforeCanPickup = 10;
par2World.spawnEntityInWorld(entityitem);
}
Yeah...
Sorry for my English.
My English is so worse.