I don't think that this is possible, but there's kinda dirty way you could do that. Just use Code (Text): /setblock ~ ~ ~ mob_spawner 0 replace {EntityId:Creeper}
http://minecraft.gamepedia.com/Player.dat_format#Block_Tags http://minecraft.gamepedia.com/Chunk_format#Block_entity_format (see MobSpawner)
Try Code (Text): BlockState blockState = block.getState() CreatureSpawner spawner = ((CreatureSpawner)blockState); spawner.setSpawnedType(EntityType.BLAZE)); blockState.update();
Try this: Code (Text): BlockState state = <spawnerblock>.getState(); TileEntityMobSpawner tile = ((CraftCreatureSpawner) state).getTileEntity(); MobSpawnerAbstract spawner = tile.getSpawner(); NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound properties = new NBTTagCompound(); NBTTagCompound item = new NBTTagCompound(); item.setString("id", "diamond"); item.setInt("Count", 10); properties.set("Item", item); tag.set("Properties", properties); MobSpawnerAbstract.a data = new MobSpawnerAbstract.a(tag, "Item"); spawner.a(data); state.update();
It's somewhat similar. Get the NMS ItemStack Get the tag Get the block entity tag Set the data Set the tag Get the CraftBukkit stack Set the ItemStack in the inventory.