Basic Explanation of Minecraft (Java Edition)

Introduction (What is Minecraft?) Minecraft is a best-selling video game of the survival and sandbox genres. Minecraft's first version, Classic Edition, was a Java-based game released on May 17 of 2009 by none other than the Swedish game designer Markus Persson (who also goes by the name Notch). The game is known for its blocky art style, calming and nostalgia-inducing music track by C418 and other music artists, massive community, and freedom to do basically anything you want within the game. Let's dive into what made this game what it is today. Minecraft's Java-based Engine Current-day Minecraft has two prominent versions still being worked on: Bedrock Edition and the original Java Edition. Ignoring the newer bedrock version (which uses C++), the Java version was, as the name suggests, an application written using the Java programming language. Java itself is an object-oriented, compiled, multi-threaded, and statically typed programming language. The game made use of something called the Lightweight Java Game Library (or LWJGL for short), which is a library for the Java language that helps with handling inputs, rendering graphics, and playing audio in Java applications. For a multitude of reasons, I can't exactly show you the Java code of Minecraft. What I can do is show you what Minecraft accomplishes. A Randomly Generated World Made of Chunks and Blocks Whenever you create a new world in Minecraft, the game creates a random 32-bit integer as a "seed". The same seed always results in the same world being generated. This seed is used with a Perlin noise algorithm to generate a natural-looking unique world made up of a 3D grid of 1x1x1 meter blocks. All terrain, structures, and anything else that counts as your environment are made up of blocks that are usually half the height of the player character (Steve by default). While most blocks are just a simple cube with a texture, some blocks (such as half-slabs, stairs, beds, cauldrons, etc.) have unique shapes and sizes. This world of blocks is divided up into 16x16 chunks that go from the top of the world to the bottom. When you travel around the world, these chunks load in and out of your computer's memory depending on if the chunk is in the player's render distance or not. Changes to blocks in a chunk and certain entities in a chunk are not undone whenever the chunk unloads, allowing structures made by players to persist. That's right, the player can break and place blocks and permanently change the game world around them. The Player By default, you play from the first-person perspective of a blue-shirted guy name Steve, but you can always change your character's name and skin to custom ones. The player can collect materials from mining blocks and slaying mobs, store items in chests or their inventory, craft new items from the materials they collected, build a home out of the blocks they mined, etc. Players have a health bar that shows their remaining hit points, a hunger bar that shows their current hunger, an armor bar that shows their current level of armor (armor levels reduce incoming damage), an oxygen bar that pops up when in water (you start to drown when it is emptied), an exp bar that stores exp levels to be used for enchanting items, and an item hot bar showing you a few items you can quickly switch to and use. While there are many other aspects that define the player character, doing so would be like listing off every miniscule thing a regular human being can do. Speaking of human, let's move on to something that's not about your average human. Mobs If something is not a block, then it is an entity. Entities include all boats, minecarts, armor stands, all mobs, and players. Ignoring the two vehicles and the decorative armor stand that can store and display armor, a mob is essentially just an NPC. Mobs can be friendly, neutral, or hostile. Friendly mobs run away when attacked. Some examples include chickens that lay eggs and villagers that trade with the player. Neutral mobs attack back when attacked. Examples include wolfs that can be tamed and bees that have honey-producing hives. Hostile mobs try to attack you on sight. Examples include skeletons that shoot arrows at you and creepers that sneak up on you and try to explode next to you. All of these different mobs have shared behaviors (like wandering around) and unique behaviors (like spiders becoming neutral when in sunlight). While I don't know what Minecraft's Java code looks like, I can take a guess that there is probably a class that defines a general mob and subclasses that produce instances of specific mobs. Let me show you what I mean. Simplified Example of Mob Java Code class Mob { protected String entityType = "Mob"; public int[] wander(int[] Coords) { // insert some complicated code here that takes in a mob's current coordinates and returns the new coordinates of the mob after it moved } } class Creeper extends Mob { public int[] Coords = {76, 53, -30}; private

Feb 3, 2025 - 05:09
 0
Basic Explanation of Minecraft (Java Edition)

Introduction (What is Minecraft?)
Minecraft is a best-selling video game of the survival and sandbox genres. Minecraft's first version, Classic Edition, was a Java-based game released on May 17 of 2009 by none other than the Swedish game designer Markus Persson (who also goes by the name Notch). The game is known for its blocky art style, calming and nostalgia-inducing music track by C418 and other music artists, massive community, and freedom to do basically anything you want within the game. Let's dive into what made this game what it is today.

Minecraft's Java-based Engine
Current-day Minecraft has two prominent versions still being worked on: Bedrock Edition and the original Java Edition. Ignoring the newer bedrock version (which uses C++), the Java version was, as the name suggests, an application written using the Java programming language. Java itself is an object-oriented, compiled, multi-threaded, and statically typed programming language. The game made use of something called the Lightweight Java Game Library (or LWJGL for short), which is a library for the Java language that helps with handling inputs, rendering graphics, and playing audio in Java applications. For a multitude of reasons, I can't exactly show you the Java code of Minecraft. What I can do is show you what Minecraft accomplishes.

A Randomly Generated World Made of Chunks and Blocks
Whenever you create a new world in Minecraft, the game creates a random 32-bit integer as a "seed". The same seed always results in the same world being generated. This seed is used with a Perlin noise algorithm to generate a natural-looking unique world made up of a 3D grid of 1x1x1 meter blocks. All terrain, structures, and anything else that counts as your environment are made up of blocks that are usually half the height of the player character (Steve by default). While most blocks are just a simple cube with a texture, some blocks (such as half-slabs, stairs, beds, cauldrons, etc.) have unique shapes and sizes. This world of blocks is divided up into 16x16 chunks that go from the top of the world to the bottom. When you travel around the world, these chunks load in and out of your computer's memory depending on if the chunk is in the player's render distance or not. Changes to blocks in a chunk and certain entities in a chunk are not undone whenever the chunk unloads, allowing structures made by players to persist. That's right, the player can break and place blocks and permanently change the game world around them.

The Player
By default, you play from the first-person perspective of a blue-shirted guy name Steve, but you can always change your character's name and skin to custom ones. The player can collect materials from mining blocks and slaying mobs, store items in chests or their inventory, craft new items from the materials they collected, build a home out of the blocks they mined, etc. Players have a health bar that shows their remaining hit points, a hunger bar that shows their current hunger, an armor bar that shows their current level of armor (armor levels reduce incoming damage), an oxygen bar that pops up when in water (you start to drown when it is emptied), an exp bar that stores exp levels to be used for enchanting items, and an item hot bar showing you a few items you can quickly switch to and use. While there are many other aspects that define the player character, doing so would be like listing off every miniscule thing a regular human being can do. Speaking of human, let's move on to something that's not about your average human.

Mobs
If something is not a block, then it is an entity. Entities include all boats, minecarts, armor stands, all mobs, and players. Ignoring the two vehicles and the decorative armor stand that can store and display armor, a mob is essentially just an NPC. Mobs can be friendly, neutral, or hostile. Friendly mobs run away when attacked. Some examples include chickens that lay eggs and villagers that trade with the player. Neutral mobs attack back when attacked. Examples include wolfs that can be tamed and bees that have honey-producing hives. Hostile mobs try to attack you on sight. Examples include skeletons that shoot arrows at you and creepers that sneak up on you and try to explode next to you. All of these different mobs have shared behaviors (like wandering around) and unique behaviors (like spiders becoming neutral when in sunlight). While I don't know what Minecraft's Java code looks like, I can take a guess that there is probably a class that defines a general mob and subclasses that produce instances of specific mobs. Let me show you what I mean.

Simplified Example of Mob Java Code

class Mob {
  protected String entityType = "Mob";

  public int[] wander(int[] Coords) {
    // insert some complicated code here that takes in a mob's current coordinates and returns the new coordinates of the mob after it moved
  }
}

class Creeper extends Mob {
public int[] Coords = {76, 53, -30};
private void explode() {
  system.out.println("kaboom");
}
  public static void main(String[] args) {

    // Create an object from Creeper
    Creeper creeperInstance = new Creeper();

    // call wander
    creeperInstance.Coords = creeperInstance.wander(Coords);

    system.out.println(creeperInstance.Coords);

    // call explode
    creeperInstance.explode();
  }
}

My skills with Java are subpar, so please bear with me here. I created a Mob class and a Creeper subclass that extends from the Mob class and, as a result, inherited the entityType of "Mob" and the wander method. When an object representing a single creeper is made using the Creeper subclass, the creeperInstance object has access to the wander method in the Mob class and can use this method to reassign the individual creeper's coordinates. The creeper object has access to the explode method from the Creeper class, with said method being unavailable to be used by other mobs. Now let's talk about mods.

Community and Mod Support
Minecraft's community is passionate and has been around for many years, helping to keep the game alive with things like YouTube videos, fan art, custom game servers, animations, and mods. Mods are modifications done to a video game that adds new content and/or mechanics to the game, removes a certain quirk in the game that you may not like, or otherwise alters some aspect that makes up the video game. For Minecraft Java Edition, mod loaders like Forge and Fabric are available. A mod loader is any type of program that helps to simplify the process of organizing and installing mod files into a game. Instead of manually placing or replacing files in a game and potentially messing something up, mod loaders do that for you in a safe way (it doesn't just permanently replace the base-game's files) and usually allows the user to enable and disable mods at will. Some mod loaders even tell you when a conflict between mods is detected, with a mod conflict being when one mod's code conflicts with the code of another and causes the conflicted mods to no longer work properly. Anyways, this blog needs to end sooner or later so...

Conclusion
After being written in Java and released in 2009, Notch's game went on to be one of the most beloved video games of all time. Minecraft is set within a world made of cubes that can be shaped to the player's will while they try to survive the night and eventually defeat the ender dragon. Minecraft utilized random world generation, the ability to alter terrain, randomly spawning NPCs, different dimensions, status effects, and many other game mechanics to build up an amazing game.

Links to Sources Used

Link to Title Image Used