Will It Host? / The Sims 4

Can you run a Minecraft server in The Sims 4?

It hosted#7 of 18 by difficulty

Yes. The process listening on port 25565 is The Sims 4, and a vanilla Minecraft client connects to it and plays on it. This is the first one that goes both ways: place a block in Minecraft and an object appears on the lot, move furniture in The Sims and the block moves in Minecraft.

verdict
It hosted
A vanilla Minecraft client connected and played on it.
difficulty
#7 of 18
Ranked against everything else in the series, hardest first.
built withPython
protocolMinecraft 1.8.9
read the source on github β†’

How it works

A script mod. The Sims 4 embeds Python 3.7 and runs mods inside the game process, so importing socket gives you a real TCP server in the game's own process. Your Sim teleports to mirror your position, its motives are wired to server state so hunger falls with the packet count and social depends on whether anyone is connected, and every connect, join, chat line and block gets its own Sims notification.

The part that nearly stopped it

The Sims 4 ignores .py source in a .ts4script and says nothing about it. Only compiled .pyc runs. The mod appeared in the in-game Mods dialog under Script Mods, so it looked installed, but nothing registered, no command existed and no lastException.txt was ever written.

What got it over the line

Compiling with Python 3.7 and nothing else, because the bytecode has to match the game's interpreter exactly. The build script refuses to run on any other version. Past that, this is the first host in the series that allows a daemon thread, so the server is independent of the game's UI and keeps serving while the game is paused; game objects are only ever touched from a sim-clock alarm draining a queue.

What it cannot do

Minecraft 1.8.9, the same target as the rest of the series. The mirror maps positions, not shapes, so a sofa is one block picked from a 16-colour palette by definition ID; objects snap to the lot grid and refuse to overlap, so a tall stack in Minecraft is not always a tall stack of furniture; and the visuals freeze while the game is paused even though the connection survives.

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 The Sims 4 can be made to do it. In every episode the host is the hard part.

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 The Sims 4 run a Minecraft server?

Yes. The Sims 4 embeds Python 3.7 and script mods run in the game process with an intact standard library, so socket, struct, threading and queue all work. The catch is that the game only loads compiled .pyc and ignores .py source without any error at all. The full source is on GitHub.

Does the furniture really turn into blocks?

Both directions. Blocks you place spawn as real objects on the lot and vanish when you break them, and every object on the lot is mirrored back into the world as a block, updated as you move or delete furniture. The mod excludes its own spawned objects from the mirror, otherwise placing a block would spawn a table and the table would send the block straight back.

The rest of the series

See the full Will It Host? board β†’

Or just host it properly

The Sims 4 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.