« Back to Blog   

What I learned Mapping Minecraft Worlds
April 27, 2018
By Jeff K.

Minecraft is getting a little stale for me now. I’ve done my exploring, and exploiting. Nothing left but… to look at the database!

Each Minecraft world has its own folder in the save directory, with other subfolders and a lot of data files. I noticed that each map created in the world is a separate file, and that file is in GZip format, and there is a library for Python to look at them. So, I would tediously explore the world, creating maps and then look at the database. The worlds we have on our server are limited in size plus and minus 1024 blocks. Each map displays 128 pixels, a pixel being one block at the closest zoom, and can be 16 x 16 blocks at furthest zoom. Plus, the maps have a funny center offset of 64. That means at highest resolution, to cover our explorable world, 17 x 17 maps are needed. First, I would go to -1024, -1024 and create my first map (being Map_0). Then I would move 128 east and do it 16 more times (to location 1024, -1024). Then I’d go back to -1024 and go south 128. That would be Map_17, and so it goes until Map_288. How tedious (more about that later). But then I have 289 maps, all of which I know how to unpack, and I could then generate a map!

But I don’t stop there, oh no! I also can decode other files in the database to find height information and region information, and locations of interesting structures — although labels and making points visible is still a hand-done process. *** Something Learned *** PNG files support transparent areas. Alas, Microsoft products seem to not support it. However, one may drag a PNG picture into Powerpoint, use the Picture Tools Format tab, go to Color and choose Set Transparent Color. Then click on the background color of your picture and it will disappear! Then you may right-click on the picture and save it. Having transparent areas will let me overlay features on my map.

*** Something Learned *** How to make pictures with overlays? Welcome to CSS. The key is to make all images placed in the same absolute position.

img
{
position:absolute;
top: 36px;
left: 0px;
}

#base
{
z-index: 10
}

I also assigned z-index to my photos — just to be sure.

In HTML I installed buttons, stacked my maps: Topological, Regional, Altitude; stacked my overlays: Mine Rails, Spawners, Features, and Grid. Here is the link to a world I want to become our new Amplified world: http://wilkinsfreeman.info/mc/layers.htm

Back to tedious map making. The reason I stay with Office 2010 products is because later versions reduce functionality for security reasons. With Excel 2010, I am still able to make system calls and use AppActivate and SendKeys. Let me tell you how I automated map making.

The first task is to get into the Minecraft world. Then one must be able to go into creative mode. My program transports at altitude, to it is wise to start out flying, and looking in an interesting direction, and have nothing in your hands or inventory. To run the program requires pausing Minecraft, and I use chat. So, the first thing my program needs to do is to get out of chat. I put in a lot of time delays using Now and While loops. Now returns time to the second, so this will wait one second.

t = Now
While t = Now
DoEvents
Wend
AppActivate “Minecraft 1.12.2”, False
SendKeys “~”

The ~ is the way to send Enter. AppActivate selects Minecraft as the active window, and then SendKeys sends the Enter.

Next I set up loops to go from -1024 to 1024 in steps of 128 in both directions. I found that sending the complete command to Minecraft sometimes doesn’t work, so I send the / to start the command, wait, then send the rest of the command. The first command teleports me to the chosen location, the next command gives me an empty map, then I right click to use the map, then I send Q to throw the map away (since there will be 289 maps, I can’t hold them all).

I have found that a one second wait after the transport may not be enough. My current program (not quite perfect) goes “/” one second “tp -1023 160 -1023~” two seconds “/” one second “give sigma9 map~” two seconds, right-mouse click, four seconds, “Q” and wait two seconds. That’s 53 minutes.

For z = -1024 To 1024 Step 128
For x = -1024 To 1024 Step 128
AppActivate “Minecraft 1.12.2″, False
q = Trim(Str(x)) & ” 160 ” & Trim(Str(z))
SendKeys “/”
t = Now
While t = Now
DoEvents
Wend
SendKeys “tp ” & q & “~”
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
AppActivate “Minecraft 1.12.2”, False
SendKeys “/”
t = Now
While t = Now
DoEvents
Wend
SendKeys “give sigma9 map~”
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
AppActivate “Minecraft 1.12.2”, False
‘send a down event
mouse_event MOUSEEVENTF_RIGHTDOWN, 0&, 0&, 0&, 0&
‘and an up
mouse_event MOUSEEVENTF_RIGHTUP, 0&, 0&, 0&, 0&
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
AppActivate “Minecraft 1.12.2”, False
SendKeys “q”
t = Now
While t = Now
DoEvents
Wend
t = Now
While t = Now
DoEvents
Wend
Next x
Next z
End Sub

I have found that it is wise to do the AppActivate before the mouse events. One would think one would only need one AppActivate, but no. Of course, one must then NOT TOUCH anything for the whole hour. Do not have e-mail open, do not plug in USB, do not lose power. It is okay to touch the mouse slightly if you want to be sure your computer doesn’t go to sleep.

The point of this exercise is to find interesting worlds. I prefer a world with multiple region types, several villages, a temple and witch’s hut in the explorable part. I also like to have water near spawn so I can make a quick getaway. The world in the map example only has 3 villages, which is disappointing, but it has a lovely ocean (not too much) and two witch huts just right there. The desert Temple is there in the upper right corner, but it is buried under the amplified terrain.

I will be exploring more world possibilities. Try LCM+L for the seed and you will get Antarctica.

About the Author
Jeff K.
Vintage Hardware Restoration Engineer
As a kid, Jeff became interested in how machines work after reading Benny the Bulldozer by Edith Thatcher Hurd (1947). In high school, Jeff took his first computing classes, including a math class that taught him to plot a spirograph on a HP 91000B calculator. Jeff eventually enjoyed a thirty-five year career as a technician with Strobe Data, before joining LCM+L’s engineering team to work on the Xerox Sigma 9 mainframe computer. Today you can find Jeff tinkering away upstairs on the IBM 360/30.

He continues to plot spirographs on computers.
About the Author
Jeff K.
Vintage Hardware Restoration Engineer
As a kid, Jeff became interested in how machines work after reading Benny the Bulldozer by Edith Thatcher Hurd (1947). In high school, Jeff took his first computing classes, including a math class that taught him to plot a spirograph on a HP 91000B calculator. Jeff eventually enjoyed a thirty-five year career as a technician with Strobe Data, before joining LCM+L’s engineering team to work on the Xerox Sigma 9 mainframe computer. Today you can find Jeff tinkering away upstairs on the IBM 360/30.

He continues to plot spirographs on computers.

Category Tags
Software