Can you summon a Mob Spawner of any type with commands? If so, how?
I know there is some way to use monster spawners another way than to use them in their natural location...I just don't know how. Especially in normal Minecraft. There has to be some command you can use.
Best Answer
The wiki has a list of NBT data for spawners here: http://minecraft.gamepedia.com/Mob_spawner#Data_values
And a list all entity data here: http://minecraft.gamepedia.com/Chunk_format#Entity_format
The /setblock command can create a physical block in the world, adding necessary data to tile entities:
/setblock X Y Z <block ID> [Damage] [replacement method] {dataTags}
An example, where a creeper will spawn with a fuse timer of 1 tick. Any data not specified for the spawner will use the defaults.
/setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {EntityId:"Creeper",SpawnData:{Fuse:1s}}
The /give command can create a mob spawner for inventories. The BlockEntityTag tag for the item format will hold potential tile data for the block when it is placed.
/give <player> <item ID> [Count] [Damage] {dataTags}
/give @p minecraft:mob_spawner 1 0 {BlockEntityTag:{EntityId:"Creeper",SpawnData:{Fuse:1s}}}
Pictures about "Can you summon a Mob Spawner of any type with commands? If so, how?"



How do you get spawners with commands?
The only way to obtain one is by using the /give command, which gives a pig spawner by default; afterward the mob can be changed by using a spawn egg on the placed block. A /setblock , /clone or /fill command can also be used to obtain a spawner.How do you spawn a custom spawner in Minecraft?
How to Change the Mob in a Monster Spawner in MinecraftHow to spawn unlimited mobs on minecraft
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Vie Studio, Erik Mclean, Anna Shvets, Tima Miroshnichenko
