tutorial/mobspawners
How to edit MobSpawners
Warning!
This action is very dangerous.
Make sure that you have a backup
and remember x:y:z coordinates and world of mobspawner.
If an error occurs you will not be able to join the server
If this happened, see the instructions below
Edit parameters
- type command:
/nbt %b select
Select a block by right-click:
[PowerNBT] block MOB_SPAWNER at [location] selected as b - Change entity type:
/nbt %b EntityId = "Spider"
see http://www.minecraftwiki.net/wiki/Chunk_format for entity types - Change delay:
/nbt %b MinSpawnDelay = 20
(20 ticks = 1 sec)
/nbt %b MaxSpawnDelay = 40
- Change spawn range:
/nbt %b SpawnRange = 5
(5 blocks)
The spawn area is square, includes the block the spawner is in, and is centred around the spawner's x,z coordinates - not the spawner itself
All tags: http://www.minecraftwiki.net/wiki/Chunk_format
Customize parameters
For 1.4.6 and later
- Select new compound as variable t:
/nbt %t select compound
>> [PowerNBT] selected as t - (Required!) Set values:
/nbt %t Weight = 5 int
>> [PowerNBT] new value set: int : 5
where 5 = chance that this spawn will be picked as compared to other spawn weights
/nbt %t Type = "Skeleton"
>> [PowerNBT] new value set: string : Skeleton
- (Optional) Edit properties of mob:
First, you need to prepare the entity tag (see below)
Next, type:
/nbt %t Properties = buffer
- Append tag %t to spawner:
/nbt %b SpawnPotentials[] = %t
>>[PowerNBT] new value set: compound : 3 elements
- Now you can repeat this for other entity types
Prepare the entity tag
- Clear the buffer:
/nbt compound copy
- Now edit buffer as if you edit the entity,
but you need to specify the types of values
Examples:
/nbt buffer Health = 100 short
/nbt buffer CanPickUpLoot = 1 byte
See http://www.minecraftwiki.net/wiki/Chunk_format#Mobs
!Warning!
If you will change the mob equipment , you need to create all 5 tags:
/nbt buffer Equipment[4] = compound
it will create all tags Equipment[0] ... Equipment[4]
Then you can edit any of these tags:
/nbt buffer Equipment[0] = inv [0]
(item in your first slot)
If it will be less than 5 items, there will crash! (Thanks @My_Name_Was_Stolen for testing)
Video example
1.4.7
1.5 and later
How to recover spawner
Method 1:
Restore the backup file. (tritely)
Method 2:
Remove spawner block with MCEdit
Method 3 (without restarting the server):
make sure that you know the coordinates of the spawner by console command /nbt x:y:z:world
where x,y,z - coordinates and world - world name
You must see the spawner tags.
Next commands that should help you:
/nbt x:y:z:world remove
(reset tags to default)
/nbt x:y:z:world RequiredPlayerRange = 0 short
(do not spawn anything)
/nbt x:y:z:world EntityId = "Cow"
(set any other existing mob)
complete!
Method 4 (without restarting the server if you has not coordinates):
it is assumed that you have a WorldEdit
1) Make backup of your player.dat file
2) Set the view distance: tiny (in game potions)
3) Move your spawn location away from the block
You can edit your offline position from console:
/nbt @Player Pos[0] = X
/nbt @Player Pos[1] = Y
/nbt @Player Pos[2] = Z
or just login with other name ;)
4) Join the game
5) Select the area with a wand, which will be spawner, but do not go near them!
6) //
replace 52 air
If none of the methods did not help, please let me know (in comments, PM or email)
do not forget to attach a log file (all executed commands)
One more method that i always do first (failsafe method), only work in some case though
Login with the account closest to the corrupt spawner (or just move your character, whatever)
Random click around and hopefully you destroyed the corrupted spawner before it crashes the server