This thread will aim to answer several questions of creating Custom Spawners using the program NBTExplorer. I will do my best to make sure the instructions are as simple as I can make them. Please make sure you read through all of the questions answered below before posting any of your own. I will try to answer any additional questions posted to the best of my ability.
Now then, to Custom Spawners.
"What is a Custom Spawner?"
To those who do not know, a Custom Spawner is just what it sounds like. A Mob Spawner edited by a player to have unique aspects. Changeable features include the type of mob spawned, the speed the Spawner spawns mobs, the number of mobs spawned, the limit of mobs before spawning is paused, etc. (you'll likely see the word spawn a lot in this thread). It can be a tricky process, but is a very useful feature for Mapmakers.
"How do I edit a Spawner?"
First you'll need to place a spawner in a world. To make things easy on yourself, simply make a creative test world (the Redstone Ready superflat setting is good for this). This will lower the entity count substantially, as no mobs can spawn. Make sure to switch the doMobSpawning gamerule to false before nightfall. Once you've done all that, type /give (username) minecraft:mob_spawner, and place it. If the mob you want to spawn has a Spawn Egg, right click the Spawner with it to simplify things further (if your mob does not have a Spawn Egg, scroll down for instructions on manually changing the mob type of the Spawner). Much of making Spawners involves finding ways to expedite the process. Lastly, place a sign on the Spawner, and write something unique on it (I use, "_msloc_"). Then exit your world.
Now to the tricky part.
"How do I find my Spawner in NBTExplorer?"
This is where the sign you placed will help. Click on the world the Spawner is in to Highlight it. Then click Search at the top of NBTExplorer, click Find, and a small window will open. Ignore Name for now, and type what you wrote on the sign into the Value box. This should take you to the chunk where the Spawner is located. Above the string (strings look something like this: Aa), "id:minecraft:sign," should be a tag with a number, followed by, "entries." Minimize this tag, and you'll see a small list of Tags with similar names, all ending with, "entries." Open each one until you find one with the string, "id: minecraft:mob_spawner."
This is the Spawner block's location, and where you will be customizing it.
"The mob I need doesn't have a Spawn Egg. What do I do?"
Following the instructions above to locate your Spawner, open the List in your Spawner called SpawnPotentials. Inside should be a tag about entries- open this, and then open the tag inside called Entity. There should be a String called, "id: minecraft:(mob name)." Double click it to open a window. Keeping the minecraft: part, type the name of your mob in place of what it was before, and click Ok (for example, if the Spawner was a Pig Spawner and you wanted Creepers, you would change, "minecraft:pig," to, "minecraft:creeper"). The next part can be done in two ways.
The first way is to save your work in NBTExplorer (click File, then Save) and open your Minecraft world. You'll notice the mob inside the Spawner has not changed. Make sure the conditions are right for that mob to spawn (grass for a pig, darkness for a zombie, etc.). Once that mob spawns, the mob inside the Spawner should change to what you intended, and all spawns afterwards will be that mob. This is because the SpawnData Tag stores information on the next mob that will be spawned. By changing SpawnPotentials, you changed the types of Mobs the Spawner can choose from, but prior to editing it, it had already chosen the original mob.
The second way is to simply open the SpawnData tag and change the mob ID inside, not unlike how you did so inside SpawnPotentials.
And finally the fun part- modifying the actual Spawner. Most of these Short Tags are obvious in what they do, but just in case I explained them.
"I want to change:"
"The Speed my Spawner spawns mobs."
Look for the Short Tags called MinSpawnDelay and MaxSpawnDelay. Play with these tags to modify the delay between spawns. Always make sure that MaxSpawnDelay's value is higher then MinSpawnDelay.
"The range my Spawner can Spawn a mob."
Altering the Short Tag SpawnRange will increase or decrease the circular area around the Spawner. This is the region that it is allowed to spawn a mob in.
"The Mob Cap of my Spawner."
The Short Tag MaxNearbyEntities controls how many mobs can be within the Spawn Range. If the value is 10, for example, the Spawner will create mobs until there are 10 within range. It will not spawn more mobs until there are less then 10 mobs in range.
"How close a player has to be to activate the Spawner."
Raise or lower RequiredPlayerRange to control the distance a player must be to a Spawner for it to start Spawning mobs. This works similarly to Spawn Range.
"How do I make a Spawner spawn customized Mobs?" (Coming Soon)
To those who are unaware, a Spawner is able to spawn mobs with unique attributes. You can control Potion Effects, Armor Worn, Movement Speed, even what the Mob drops when killed. This process, however, is a bit more complicated, so I'll be explaining that later on through a similar thread or subsection to this one.
Keep in mind that there's currently a bug with custom mob spawners, For some reason SpawnPotentials doesn't get properly updated which will result in any custom spawner to reset back to a pig spawner (= the default) after having spawned the first batch of mobs or entities.
Believe me, I know about it... It's a frustrating issue. After some experimentation, I think I found a fix for it, and it seems to work.
My Custom Spawners have not reverted since I modified them. The cause for this problem is when the you only change SpawnData and not SpawnPotentials. SpawnData holds the information of the mob it will spawn when it next activates. If you only change SpawnData, it spawns the mob you intended once, and checks the list of entities it can spawn in SpawnPotentials. It will pick an entity from that list (as you said, Pigs are default, so usually they're the only mob on that list) and replace SpawnData with that Entity's information. It works in reverse if you only edit SpawnPotentials: SpawnData still holds the original mob, while the list now consists only of what you entered. It will spawn the original mob once, then replace the Data with whatever is in SpawnPotential. Thank you for your concern though! I really should have clarified on that in the main post (I'll probably put it in when I can).
This thread will aim to answer several questions of creating Custom Spawners using the program NBTExplorer. I will do my best to make sure the instructions are as simple as I can make them. Please make sure you read through all of the questions answered below before posting any of your own. I will try to answer any additional questions posted to the best of my ability.
Now then, to Custom Spawners.
"What is a Custom Spawner?"
"How do I edit a Spawner?"
Now to the tricky part.
"How do I find my Spawner in NBTExplorer?"
This is the Spawner block's location, and where you will be customizing it.
"The mob I need doesn't have a Spawn Egg. What do I do?"
The first way is to save your work in NBTExplorer (click File, then Save) and open your Minecraft world. You'll notice the mob inside the Spawner has not changed. Make sure the conditions are right for that mob to spawn (grass for a pig, darkness for a zombie, etc.). Once that mob spawns, the mob inside the Spawner should change to what you intended, and all spawns afterwards will be that mob. This is because the SpawnData Tag stores information on the next mob that will be spawned. By changing SpawnPotentials, you changed the types of Mobs the Spawner can choose from, but prior to editing it, it had already chosen the original mob.
The second way is to simply open the SpawnData tag and change the mob ID inside, not unlike how you did so inside SpawnPotentials.
And finally the fun part- modifying the actual Spawner. Most of these Short Tags are obvious in what they do, but just in case I explained them.
"I want to change:"
"The Speed my Spawner spawns mobs."
"The range my Spawner can Spawn a mob."
"The Mob Cap of my Spawner."
"How close a player has to be to activate the Spawner."
"How do I make a Spawner spawn customized Mobs?" (Coming Soon)
Believe me, I know about it... It's a frustrating issue. After some experimentation, I think I found a fix for it, and it seems to work.
My Custom Spawners have not reverted since I modified them. The cause for this problem is when the you only change SpawnData and not SpawnPotentials. SpawnData holds the information of the mob it will spawn when it next activates. If you only change SpawnData, it spawns the mob you intended once, and checks the list of entities it can spawn in SpawnPotentials. It will pick an entity from that list (as you said, Pigs are default, so usually they're the only mob on that list) and replace SpawnData with that Entity's information. It works in reverse if you only edit SpawnPotentials: SpawnData still holds the original mob, while the list now consists only of what you entered. It will spawn the original mob once, then replace the Data with whatever is in SpawnPotential. Thank you for your concern though! I really should have clarified on that in the main post (I'll probably put it in when I can).