I got tired of walking kilometers to mine a new ore that's rarer than diamond. I also didn't want to /give or invedit because that's uninteresting. Since I couldn't find an existing utility to help me (although such utilities may exist, I have not looked especially hard), I created my own.
OreGen is a small command line utility that will generate ore deposits on all chunks of a world map.
OreGen has a data table built in for the existing ores (coal, iron, gold, diamond, redstone, and lapis), so that by default if these ores are requested, they will be generated similar to the native chunk generator (in terms of size, depth, and rarity). OreGen deposits tend to run slightly larger. You can override these parameters to generate ore in the quantity you want. You can also generate deposits of any block you wish, although you will have to specify a full set of parameters for non-ore blocks.
The utility uses cNBT to modify the chunks. I've included the source which should compile in MinGW and Linux (though I haven't tested the later).
Disclaimer: I take no responsibility for any problems that this application causes. I have tested this on SSP worlds and my SMP server, but for all I know running this application will wreck your map or jump out of your screen and rape your dog. Backup your worlds before using this application.
- Back up the world you are modifying
- Unzip nbtoolkit.exe to a directory, such as C:\nbtoolkit.
- Open a command prompt (cmd), navigate to the directory (cd C:\nbtoolkit)
- Run nbtoolkit.exe with the full path to your world directory (surrounded in quotes if it contains spaces), followed by the block ID you wish to generate.
Example: C:\nbtoolkit>nbtoolkit.exe
- Print usage information
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21
- Generate Lapis ore similarly to natural generation in new chunks
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21 -r 2
- Generate double the amount of Lapis ore
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21 -mx 16
- Generate Lapis ore concentrated into the diamond layer only (layers 16 and below)
Usage (Linux / Mac)
- Unzip source to a directory
- Make sure you have the zlib development headers and full compiler/build chain available (gcc)
- Run "make" to build nbtoolkit
- Follow the usage instructions below. See basic examples in the Windows usage section above.
Complete Usage
nbtoolkit.exe <tool> <world dir> [options]
Available tools:
oregen : Generate new ore deposits
replace : Replace one block type with another
Usage and options for 'oregen':
nbtoolkit.exe oregen <world_dir> <ore_id> [options]
Options:
-r <num> : Number of rounds ore is generated per chunk
-mn <num> : Minimum depth ore is generated (0-127)
-mx <num> : Maximum depth ore is generated (0-127)
-s <num> : Size of ore deposit (0-63) -- Defaults:
Coal = 16, Iron/Gold = 8, Redstone/Diamond/Lapis = 7
-oo : Take precedence over all existing ores
-ob : Take precedence over all existing blocks (excluding air)
-oa : Take precedence over all existing blocks (including air)
-oi <id> : Take precedence over a specific block type
Usage and options for 'replace':
nbtoolkit.exe replace <world_dir> <block_id_1> <block_id_2> [options]
Options:
-mn <num> : Minimum depth blocks are replaced (0-127)
-mx <num> : Maximum depth blocks are replaced (0-127)
-p <num> : Probability that an individual block is replaced (0.0-1.0)
Common Options:
-mb <time> : Only update chunks modified before time (as unix timestamp)
-ma <time> : Only update chunks modified after time (as unix timestamp)
-bb <x1> <y1> <x2> <y2>
: Only update chunks with coordinates bounded by the rectangle
by (x1, y1) and (x2, y2), given as decimal chunk coordinates
-e <id> : Only update chunks that contain blocks of the given id
-ne <id> : Only update chunks that don't contain blocks of the given id
-d <num> : Set block-specific data values (0-15)
-v : Verbose output
-vv : Very verbose output
I was just about to post a request for something like this,thanks.However,this isn't exactly what I wanted.What I need is a tool that generates a map and then allows you to delete specific chunks(preferrably specific parts of them) and regenerate terrain in them.If I'm not mistaken,this doesn't create new chunks,it just re-fills a place with ores?
Rollback Post to RevisionRollBack
Quote from Keeltoll »
Yo dawg I heard you like playing Portal so now you can play Portal while playing Minecraft while going to Hell.
It randomly inserts ores into the ground, replacing stone. The entire purpose is to add new ores to existing chunks without needing to regenerate or deface the surface in any way.
So no, this tool will not help give you pine or birch trees, although such a tool would be nice.
Usage: oregen.exe <world dir> <ore_id> [options]
Ore IDs:
16 = Coal, 15 = Iron, 14 = Gold, 73 = Redstone, 56 = Diamond, 21 = Lapis
Options:
-r <num> : Number of rounds ore is generated per chunk
-mn <num> : Minimum depth ore is generated (0-127)
-mx <num> : Maximum depth ore is generated (0-127)
-s <num> : Size of ore deposit (0-63) -- Defaults:
Coal = 16, Iron/Gold = 8, Redstone/Diamond/Lapis = 7
-mb <time> : Only update chunks modified before time (as unix timestamp)
-ma <time> : Only update chunks modified after time (as unix timestamp)
-oo : Take precedence over all existing ores
-oa : Take precedence over all existing blocks (including air)
Example: C:\>oregen.exe C:\Minecraft\map 21
Will generate lapis ore "roughly" similar to how the ore is natively produced on new chunks. It will hit all chunks though so chunks that already have the ore will get extra ore added to them.
Sorry - still having trouble using - I get following error "Ore ID has to be a number"
This is the command line I am using oregen.exe C:\Program Files\Minecraft\Wayville 21 - Wayville is the name of the world I am trying to alter. I have tried altering number of spaces, using different numbers - same result.
Any ideas?
You have spaces in the path to your world folder. You need to surround it in quotes. It thinks "Files\Minecraft\Wayville" is the ore id.
@Superboop: I have no access to macs to test code. It's written in fairly portable C, but I do not know if it will compile on a Mac or not. You could always copy your world folder to a Windows or Linux box (or virtual machine) and run the tool, since it's offline processing. The included exe is a Windows binary, of course.
There is no installer, it is a standalone command line application. I have updated the first post with some additional usage instructions, but you must know how to at least open the Windows command prompt and change directories.
Oh, thank you. This is almost exactly what I was looking for (for use in a world that I really did not want to render obsolete). I just wish there was some way to add birch/pine (or to 'trim' the world and force areas to generate again).
Oh, thank you. This is almost exactly what I was looking for (for use in a world that I really did not want to render obsolete). I just wish there was some way to add birch/pine (or to 'trim' the world and force areas to generate again).
you can delete single chunks which will be generated new. if you are unlucky the generator works in a way that the regenerated chunks are completely different from the old ones (e.g. 20 blocks higher), but you’ll have to find this out.
Oh, thank you. This is almost exactly what I was looking for (for use in a world that I really did not want to render obsolete). I just wish there was some way to add birch/pine (or to 'trim' the world and force areas to generate again).
you can delete single chunks which will be generated new. if you are unlucky the generator works in a way that the regenerated chunks are completely different from the old ones (e.g. 20 blocks higher), but you’ll have to find this out.
Wait, really? How do you go about doing that?
EDIT: Never mind, I found a very sleek editor that works excellently for it.
Everytime I try to add the new gem (I forget the name) it tells me that the ore ID has to be a number, even though I do it exaclty as you show in the example.
I would guess (not knowing your exact situation) that you have a space somewhere in the path to your save. Put the path in quotes and try again.
I would guess (not knowing your exact situation) that you have a space somewhere in the path to your save. Put the path in quotes and try again.
Totally didn't see those quotation marks! Worked fine now, going to try my world now. Thanks!!
That's because I was sneaky and added them to the examples after these two posts. But I did mention quotation marks somewhere in the text instructions.
This is an amazing idea, and as someone who hates downloading giant file sizes from his slow FTP server (to map and backup... since my mapping tool isn't working on my vps) this is an AWESOME solution. I have already started deleting chunks to make way for the new stuff, but this way I wont have to expand our map too much as anyone can find the awesome blue ore anywhere after using this!
My concerns: How will the new ores be added? Will they replace stone, or are we talking some of my communities underground areas may have some floating blue rocks if they are lucky? No big deal either way, I'm sure they will love that, but I wanted to ask! Also is there an option to only add the new ores? It sounds like that's the point, but some of the explanation threw me off...
Either way AWESOME idea, and I look forward to using this brilliant addition to the community! SMP admins everywhere thank you :smile.gif:
I took the liberty of modifying the code and makefile to compile for *nix (which took about three minutes - it was just adding a header file and changing the location of zlib).
Check out http://www.minecraftforum.net/topic/181988-nbtoolkit-map-processing-tools-beta-13/ for a version that works on modern Minecraft worlds.
I got tired of walking kilometers to mine a new ore that's rarer than diamond. I also didn't want to /give or invedit because that's uninteresting. Since I couldn't find an existing utility to help me (although such utilities may exist, I have not looked especially hard), I created my own.
OreGen is a small command line utility that will generate ore deposits on all chunks of a world map.
OreGen has a data table built in for the existing ores (coal, iron, gold, diamond, redstone, and lapis), so that by default if these ores are requested, they will be generated similar to the native chunk generator (in terms of size, depth, and rarity). OreGen deposits tend to run slightly larger. You can override these parameters to generate ore in the quantity you want. You can also generate deposits of any block you wish, although you will have to specify a full set of parameters for non-ore blocks.
The utility uses cNBT to modify the chunks. I've included the source which should compile in MinGW and Linux (though I haven't tested the later).
Disclaimer: I take no responsibility for any problems that this application causes. I have tested this on SSP worlds and my SMP server, but for all I know running this application will wreck your map or jump out of your screen and rape your dog. Backup your worlds before using this application.
Download: http://hocuspocus.taloncrossing.com/rii/nbtoolkit.zip
Usage (Windows):
- Back up the world you are modifying
- Unzip nbtoolkit.exe to a directory, such as C:\nbtoolkit.
- Open a command prompt (cmd), navigate to the directory (cd C:\nbtoolkit)
- Run nbtoolkit.exe with the full path to your world directory (surrounded in quotes if it contains spaces), followed by the block ID you wish to generate.
Example: C:\nbtoolkit>nbtoolkit.exe
- Print usage information
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21
- Generate Lapis ore similarly to natural generation in new chunks
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21 -r 2
- Generate double the amount of Lapis ore
Example: C:\nbtoolkit>nbtoolkit.exe oregen "C:\Users\Justin\AppData\Roaming\.minecraft\saves\World1" 21 -mx 16
- Generate Lapis ore concentrated into the diamond layer only (layers 16 and below)
Usage (Linux / Mac)
- Unzip source to a directory
- Make sure you have the zlib development headers and full compiler/build chain available (gcc)
- Run "make" to build nbtoolkit
- Follow the usage instructions below. See basic examples in the Windows usage section above.
Complete Usage
nbtoolkit.exe <tool> <world dir> [options]
Available tools:
oregen : Generate new ore deposits
replace : Replace one block type with another
Usage and options for 'oregen':
nbtoolkit.exe oregen <world_dir> <ore_id> [options]
Ore IDs:
16 = Coal, 15 = Iron, 14 = Gold, 73 = Redstone, 56 = Diamond, 21 = Lapis
Options:
-r <num> : Number of rounds ore is generated per chunk
-mn <num> : Minimum depth ore is generated (0-127)
-mx <num> : Maximum depth ore is generated (0-127)
-s <num> : Size of ore deposit (0-63) -- Defaults:
Coal = 16, Iron/Gold = 8, Redstone/Diamond/Lapis = 7
-oo : Take precedence over all existing ores
-ob : Take precedence over all existing blocks (excluding air)
-oa : Take precedence over all existing blocks (including air)
-oi <id> : Take precedence over a specific block type
Usage and options for 'replace':
nbtoolkit.exe replace <world_dir> <block_id_1> <block_id_2> [options]
Options:
-mn <num> : Minimum depth blocks are replaced (0-127)
-mx <num> : Maximum depth blocks are replaced (0-127)
-p <num> : Probability that an individual block is replaced (0.0-1.0)
Common Options:
-mb <time> : Only update chunks modified before time (as unix timestamp)
-ma <time> : Only update chunks modified after time (as unix timestamp)
-bb <x1> <y1> <x2> <y2>
: Only update chunks with coordinates bounded by the rectangle
by (x1, y1) and (x2, y2), given as decimal chunk coordinates
-e <id> : Only update chunks that contain blocks of the given id
-ne <id> : Only update chunks that don't contain blocks of the given id
-d <num> : Set block-specific data values (0-15)
-v : Verbose output
-vv : Very verbose output
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
So no, this tool will not help give you pine or birch trees, although such a tool would be nice.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
Usage: oregen.exe <world dir> <ore_id> [options]
Ore IDs:
16 = Coal, 15 = Iron, 14 = Gold, 73 = Redstone, 56 = Diamond, 21 = Lapis
Options:
-r <num> : Number of rounds ore is generated per chunk
-mn <num> : Minimum depth ore is generated (0-127)
-mx <num> : Maximum depth ore is generated (0-127)
-s <num> : Size of ore deposit (0-63) -- Defaults:
Coal = 16, Iron/Gold = 8, Redstone/Diamond/Lapis = 7
-mb <time> : Only update chunks modified before time (as unix timestamp)
-ma <time> : Only update chunks modified after time (as unix timestamp)
-oo : Take precedence over all existing ores
-oa : Take precedence over all existing blocks (including air)
Example: C:\>oregen.exe C:\Minecraft\map 21
Will generate lapis ore "roughly" similar to how the ore is natively produced on new chunks. It will hit all chunks though so chunks that already have the ore will get extra ore added to them.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
You have spaces in the path to your world folder. You need to surround it in quotes. It thinks "Files\Minecraft\Wayville" is the ore id.
@Superboop: I have no access to macs to test code. It's written in fairly portable C, but I do not know if it will compile on a Mac or not. You could always copy your world folder to a Windows or Linux box (or virtual machine) and run the tool, since it's offline processing. The included exe is a Windows binary, of course.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
There is no installer, it is a standalone command line application. I have updated the first post with some additional usage instructions, but you must know how to at least open the Windows command prompt and change directories.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
i don’t know what mingw exactly is, but will i get a linux binary or a windows binary when i manage to compile it?
you can delete single chunks which will be generated new. if you are unlucky the generator works in a way that the regenerated chunks are completely different from the old ones (e.g. 20 blocks higher), but you’ll have to find this out.
Wait, really? How do you go about doing that?
EDIT: Never mind, I found a very sleek editor that works excellently for it.
I would guess (not knowing your exact situation) that you have a space somewhere in the path to your save. Put the path in quotes and try again.
That's because I was sneaky and added them to the examples after these two posts. But I did mention quotation marks somewhere in the text instructions.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
My concerns: How will the new ores be added? Will they replace stone, or are we talking some of my communities underground areas may have some floating blue rocks if they are lucky? No big deal either way, I'm sure they will love that, but I wanted to ask! Also is there an option to only add the new ores? It sounds like that's the point, but some of the explanation threw me off...
Either way AWESOME idea, and I look forward to using this brilliant addition to the community! SMP admins everywhere thank you :smile.gif:
Creator of Paradigne
http://www.paradigne.com
I took the liberty of modifying the code and makefile to compile for *nix (which took about three minutes - it was just adding a header file and changing the location of zlib).
Modified source
Compiled for OS X
Usage is just like jaquadro described.