Minecraft-based MMO

So, this project was a particularly interesting one. Sometime in 2018 roughly, I was approached by a guy online about the prospect of building an MMO in Minecraft, using the PocketMine-MP software. I had been playing minecraft for awhile, and used it extensively as a creative outlet, where the options are seemingly endless as to what you can build. Thanks to PocketMine-MP, I was able to also use my coding skills to extend the functional possibilities into areas that Minecraft by itself could never venture into.

The design

The first step was to design a system for the MMO to operate with. I tackled them in order of what I judged to be the easiest.

Teleport Signs

These were designed in a rather simple way. Fly to an area, note the coordinates and write them down, run a command specifying coordinates, tap a sign, enter sign text (in a helpful GUI), and accept. Just like that, you now have a sign that will teleport a player to the specified coordinates! Simple, and effective.

Teleport Areas

These have more applications, and are used to designate an entire area as a “Teleport Area”, thereby enabling portals. By specifying the two furthest corners of a box, by tapping on physical objects to pass those objects’ locations into the code, you can specify an area to designate as a portal, as well as the coordinates to teleport the player to.

Zones

Now we get into a more difficult feature. Creating zones necessitated figuring out a way to determine when a player was inside an arbitrary array of points. To do so, I had to learn a bit of calculus I have since forgotten. I designed it to pop up some ephemeral fade-in/out text that displayed the zone’s name. Creation of the zone was simply a matter of flying around and running a series of commands to create the array of points to feed into the algorithm. Once saved, you had your zone.

Mobs

I also created a simple mob system, with two types of mobs. The first one was a mob that would randomly wander within two radii, the soft radius and the hard radius, to add some dynamism. The idea behind this was to make their random wandering random enough, to make it unpredictable. I might specify a soft radius of 10, and a hard radius of 15, for example. The mob would wander 90% of the time in the soft radius, and 10% of the time within the hard radius (practically keeping it in the soft radius most of the time by chance). This, plus an entity ID to do the wandering, and I could easily spawn these wandering mobs anywhere!

The second type of mob was a pathing mob. Simply put, it’s a mob with a predefined path to follow. This path was specified by an administrator running a command, and then the game would record the path the admin walks (or flies). Once saved, this recording becomes the path for the specified entity id. I remember making an ender dragon spawn in such a way, swooping down, before flying off into the sunset! Terrifying, yet beautiful!

Instancing

This feature was a particularly neat one. Zone instances would allow you to define a zone as an “instanced” zone. Meaning, that this zone would teleport players into their own copy of the zone, ensuring that anything they do within it is unique to them. I also implemented a party system that would allow party members to teleport into the same copy of that zone, based on who the leader is. This actually took copies of the entire world, and teleported the player into them, so the instancing was perhaps not terribly efficient, but it worked, and was quick with only a half-second hitch between creation and teleporting the player into it. Neat!

Groups

Of course, groups was a part of this as well, as mentioned previously. Not much to them, but there was the distinction of the group leader, a party chat, and group members. Not a lot to it, but a prerequisite for a lot of other things!

Quests

I was in the middle of designing a quest system, but…

The end

Unfortunately, this project was canceled before it was released, but I still have the code on GitHub if someone wants to take it up. Definitely was a fun project as Minecraft is in general, and a part of me wants to resume it, but it isn’t a priority in my life right now. Cheers!