Will It Host? / Obsidian

Can you run a Minecraft server in Obsidian?

It hosted#4 of 4 by difficulty

Yes. A real TCP server runs inside Obsidian's own process and a vanilla Minecraft client connects to it and plays, while the notes app writes the server's own status into a note as you go.

verdict
It hosted
A vanilla Minecraft client connected and played on it.
difficulty
#4 of 4
Ranked against everything else in the series, hardest first.
built withJavaScript
protocolMinecraft 1.8.9
read the source on github →

How it works

Obsidian plugins are JavaScript with Node access, which means a genuine TCP listener in the application process speaking the Minecraft 1.8.9 protocol directly. No mods and no server jar. Leave a note open while you play and it rewrites itself twice a second with your position, the packet counts and an ASCII map of where you are standing, all written by the thing serving the world.

The part that nearly stopped it

Less than the others, and the runtime is the reason. Obsidian plugins are JavaScript with Node access, so a real socket and real async were already there, where the two VBA builds had to work around having neither. The interesting work moved to what the note displays rather than to keeping the server alive.

What it cannot do

Minecraft 1.8.9, the same target as the rest of the series, where a chunk is a flat byte array that can be sent uncompressed rather than the zlib-compressed format modern versions expect.

Why this is possible at all

A Minecraft Java server is a smaller thing than its reputation suggests. It is a socket, a packet codec and a game loop. The client opens one TCP connection, sends a handshake naming its protocol version, moves through login into the play state, and from then on both sides exchange length-prefixed packets describing chunks, entities and movement. None of that needs a game engine. It needs something that can hold a socket open and put the right bytes on it in the right order, which is why Obsidian can be made to do it and why the interesting part of each episode is the host rather than the protocol.

Every build in this series targets Minecraft 1.8.9 for one specific reason. In 1.8 a chunk is a flat byte array you can send uncompressed. From 1.9 onward chunk data is palette-encoded into bit-packed longs and the connection expects zlib, which is not something you can hand-write in VBA. 1.8.9 is the last release where the whole protocol is within reach of a scripting runtime that was never meant for it.

We have written both halves of that up properly: how the Minecraft server protocol works covers the wire format, and what a Minecraft server actually needs to run covers the four things a real one cannot do without.

Questions

Can an Obsidian plugin run a server?

Yes. Obsidian plugins are JavaScript running with Node access, so a plugin can open a real TCP listener in the Obsidian process. That is all a Minecraft server needs at the networking layer, which is why this one is a genuine server rather than a client or a proxy. The full source is on GitHub.

What does the note actually show?

The server writing about itself. Position, packet counts and an ASCII map of where you are standing, rewritten twice a second by the same process serving the world. Open the note, leave it open, and play.

The rest of the series

See the full Will It Host? board →

Or just host it properly

Obsidian is not where your survival world should live. AMD Ryzen 9700X, hard-reserved RAM, NVMe, online in under a minute with a free address, DDoS protection and a 7-day money-back guarantee.

Cookies