Unofficial L1T Minecraft Server Dynmap Project

This post is about the software I created for the L1T Minecraft Server. This is in no way anything official. AFAIK there is no official dynmap.

I’ve noticed that the L1T server has no dynmap available. So I set out to fix that!

How you might ask? The unix way :open_mouth:
Of course I don’t have access to the server, where dynmap plugins usually reside. But my client can render a ingame-map just fine, using mods like Xaero’s World Map. I’ve noticed that it even has a export-png function. And that’s all we’ll need!

In the github repo, there are a bunch of scripts.

It works like this:

Ingame, you press the + key to open the options for the world map, then press Export PNG. This writes the exported world map data to ~/.minecraft/map exports/.

The watch.sh script watches that directory using inotifywait, and calls update.sh when the files inside that directory have changed.

update.sh gets the latest image from the exports directory, and upscales it to the various versions. It also creates a tarball of the current directory.

The dynmap is now mostly updated. You can use it now, and if you’ve used the start.sh script to start this setup, the busybox httpd should now serve the dynmap at http://0.0.0.0:8080/.

For my setup though, another step is necessary, because my host computer isn’t always available. I’ve added a simple script to download the tar archive created in update.sh(also served via the httpd), and extract it on my server periodically, so the dynmap stays online, even if the computer I play Minecraft on doesn’t.

The rest of the magic happens in the browser. I’m using a Javascript to render the actual map. Don’t look at the code to long, or it might catch on fire. I’m not using any libraries at all, just straight DOM.
Basically, the map is the background image of a div, and the background image position is used to scroll the map. Essentially, the map works by manipulating CSS variables via Javascript! :sweat_smile:

One thing to note is that the exported .png doesn’t have any position information; Getting the “block position” based on a click requires manual calibration(In offsets.js, along with the default scroll position). This is why the reported block positions might be (slightly) off sometimes…

Also the map is only as accurate as the creator’s exploration - if something changes, and I’m not close, the map will not reflect that change. Please tell me what(where) I should map!

I’m also currently implementing markers for the map.

If you want to add a marker for anything(your house, a shop, public nether portals etc.), please the block position and a short display name below! Preferably also your IGN. This could also be useful just as a list of POI’s. Maybe also create a list at spawn soon? Just a thought…

As for other features - the map is of course limited by the way it’s created, so I don’t think it will ever have player positions etc.

My Server hosts the dynmap here. Again, not official, definitely running on my cheap german VPS.

5 Likes

Just a heads up, the “this repo” link on your server just links to the server page, not the repo page on github.

Edit: Hey just so you know (and to be clear, I haven’t been on Minecraft in quite some time, so I don’t quite know the know), but I followed your guide using Minecraft Java Edition (v1.16.4, which is what the server is on), and installed Minecraft Forge (client) and Xaero’s World Map Mod, I can log onto the server and pull up the map no problem. But no “map exports” directory was made in my ~/.minecraft directory, so the simlink failed and update.sh fails due to the simlink not actually going to a real directory.

Also, it may be worthwhile to include in a README that this is dependent on imagemagick and inotify-tools. Not that that’s a big deal or anything, but I don’t think that those comes stock with most of the mainline distros.

If I can get it running on my machine I can issue a pull request, if you’d like.

That being said, nice work! This is a cool idea!

Hm. Does Minecraft open a folder with all the map exports when you click the “export png” button in the settings?
When I click the export button in minecraft, caja(My file manager) opens up, and I assumed the export directory would always be ~/.minecraft/map\ exports/.
I’ve added a README and dependencies as you suggested(Kind of just forgot before).
It would be cool if someone besides me uses this software, all tough it’s definitely a total hack. Thank you for your positive feedback!
EDIT: I’ve updated the repo, so maybe try to pull the changes, and see what happens? I don’t think anything related should have changed though.

I’ve added Support for markers now!
They currently only are visible at the most-zoomed out level.
If you hover over the white bubbles on the map, a tooltip pops up and shows you the name of that location.

1 Like

It sounds really cool , I wouldn’t even have thought of it. Thanks for the work!

1 Like