Modded Minecraft Basics

From GT New Horizons
(Redirected from NBT)

This page aims to bridge the knowledge gap between players who know little more than "push button to play game" and being able to install or update GT:NH manually, setup a server, and other behind the scenes tasks. Many of the more technical tutorials use a lot of acronyms and concepts that may be unfamiliar, which will be explained here in greater detail. While broader in scope than most of our Wiki articles it will be still looking at these concepts through the lens of GT:NH.

Java Primer

Modded Minecraft 1.7.10 runs on Java. To run, the appropriate Java Runtime Environment (JRE), commonly just called Java, must be installed on the host computer. Java is both a programming language and an environment that allows many different operating systems and hardware/architecture configurations to all execute the same code or programs. Java is packaged as .jar files. Mods are also written in Java, so they too have the .jar extension. Jar files are a variant on the .zip format, notably with the special inclusion of META-INF/MANIFEST.MF - an inventory of what should and shouldn't be in the package. Older players may recall the days of having to manually delete the META-INF file from Minecraft's JAR after adding a mod, or it would refuse to launch.

GT:NH can be run under two different versions of Java - Java8 or Java17+. Minecraft 1.7.10, the version New Horizons is built on, originally only worked with Java8. That was the modern Java edition at the time, more than nine years ago. However, while Java8 continues to work and be supported, it is not very good by today's standards and has significant issues with garbage collection in particular. LWJGL3ify is a mod that allows old 1.7.10 Minecraft to run on modern versions of Java, specializing in Java17+. If a J17-21 client or server GTNH modpack zip is downloaded, it comes with LWJGL3ify and a couple other compatibility mods inside. The zips may still reference 17-20, but Java21 has been reported to work, as well.

Java is not the only thing GT:NH needs to run. There is no official mod loader or API for Minecraft. Modded minecraft packs make use of mod loaders, in our case one called Forge, to resolve inter-mod conflicts and add all the necessary files to an instance of vanilla Minecraft that turns it into GT:NH. To add to this house of cards, some mods are dependent on another mod to work, or need to be updated to fix compatibility, security, or feature issues. Many of the mods are OSS - open source software, which can be directly programmed by the developers with more or less ease. A handful of mods in GT:NH are ARR - all rights reserved and cannot be legally modified and distributed and have to be patched at runtime by yet another custom mod. The complexity and level of integration between mods makes it difficult to add more mods to GT:NH without breaking something. Additional Mods covers known compatible options, but often throwing a random mod into the mix will simply not work because too many things are different from vanilla.

Quirks

'meta ore'
Lighting glitch

Minecraft 1.7.10 is old by today's standards, and it has a variety of bugs, glitches and quirks that newer players may be unfamiliar with. GT:NH with its many mods adds even more unexpected behaviors, but also fixes many of the persistent pain points this version of Minecraft had.

Ghost blocks are caused by a desync in data between the server and client, causing the player to become stuck in an invisible block. The client thinks a block is in one state, while the server thinks it's in another (open/closed, broken/placed, etc.) But wait, why does this also happen in SP? Single player Minecraft still runs a server, it's just invisible to the end user. Ghost blocks are more frequent when the player is doing things faster than would be possible in vanilla 1.7.10 - insta-mining with Tinkers Tools with lots of redstone/speed, running quickly through doors wearing speed boosting boots, etc. The only way to avoid ghost blocks (mostly) is to slow down. Ghost blocks can be synced by attempting to place a block in their location, hitting the block below the ghost block, logging out and logging back in, or going far enough away to unload the offending chunk and come back. If SP or OP'd, teleports can also get a player unstuck from a troublesome ghost block. Similar visual juddering can happen with doors, particularly if entered at a sharp angle.

GT:NH uses custom Ore Generation to place its many materials in the world. What many players will never see is the means it uses to accomplish this - Tile Entity data on a 'meta ore' block. Rarely these blocks can be uncovered when mining and fail to update to their correct ore type. Touching or placing anything near the block should fix it; if it doesn't, there may be more serious problems with the pack installation.

Entities also have some unusual differences. Villagers sleep at night, laying down. This can place their heads inside blocks which will make them suffocate. They also may exhibit "panic" behavior during the day, possibly due to a lack of nearby Witchery guards. All passive animals have a chance to explode on death. All entities can push other entities into walls, potentially causing them to become stuck and suffocate.

Lighting glitches are fairly persistent and potentially dangerous. Sometimes the game simply does not realize an area is actually lit and treats it as dark. Placing anything in the area or even walking through it usually fixes things. This is a common sight in Lootgames dungeons.

A potentially useful bug exists where oak and dark oak tree branches can break any block. This can be used to punch through the bedrock roof of the Nether.

NBT File Format

NBT nested data tree of BotaniaVars.dat

NBT (Named Binary Tag) is a nested data file format exclusive to Minecraft. It's used to save/set attributes for items, entities, chunks and more both in-game and in files. level.dat[1], the file that controls things like weather, game mode, version and seed, or player.dat[2], the file that saves everything from player health, location, to inventory, are both NBT files. The attributes of a Tinker's Construct tool are saved with NBT, so too are the genes of a Forestry bee. This data is not human readable by default and has to uncompressed with software like NBTExplorer or NBT Editor (web). Multiple extensions are used for NBT files, including .nbt, .dat, .mca, .schematic and .thaum. If encountering a file in an instance folder that looks like gibberish in a text editor, there's a good chance it's an NBT file.

NBT tags can be used with commands to spawn, alter or delete things. NEI stores NBT data with bookmarked items by default and this setting should never be turned off without good reason, as items with missing NBT data can crash the game.

A Brief History of Modded MC

Very early modded Minecraft tended to focus on singluar mods, and modpacks were unheard of. This was because it was very difficult or even impossible (short of rewriting the Java code) to get multiple mods to run together if they both changed the same things in vanilla. Adding a mod involved opening up the Minecraft .jar file and manually moving, deleting and replacing various files in exactly the right places (don't forget META-INF!), and praying it all worked.

Modded Minecraft got a huge boost from the first titular ModLoader, which simplified a lot of the backend stuff to make modded code easier to integrate with vanilla and paved the way for Forge. The concept of a mod adding new blocks and items is pedestrian these days but it was a major accomplishment back in Alpha. Mods got more complex and the bigger the better. It was still difficult or impossible to combine certain mods, so many of the early well known staples were "kitchen sink" style, with a theme. Railcraft was all about trains, IndustrialCraft was about machines (and the ancestor of GregTech), the Aether added a whole new dimension, etc. Modpacks weren't really a thing, and at best could be something like A+B+C, where B and C were usually small quality of life mods. Custom maps were hugely popular and could be combined with a modded experience for even more variety. Modded was largely a single player only experience, due to SSP and SMP having different clients until 1.3. There was also a very impractical block ID limit of 256/4096 that restricted how many new blocks could be added to one instance of Minecraft.

Enter Forge. It's no understatement to say Forge is directly responsible for the modded Minecraft we know and love today. Born from the combined efforts of some of the biggest mod makers of the time and forked off the foundation of ModLoader, Forge sought to solve once and for all the problem of inter-mod conflicts, block/item ID assignments, and allowing players to have many mods all in the same game without needing a programming degree to make them work. It eventually led to ForgeModLoader, which ended for good the need to edit Minecraft's files manually for a modded experience.

One of the new problems that arose from this new frontier was a duplication of content. Many large mods added new ores, ingots and other resources to vanilla, but wouldn't be capable of using another mod's version. Understandably having four different copper or tin ingots was not only a headache for players (which of these did I need to make the wrench again?) but a problem with world generation too, as it could make resources far too abundant. Ore Dictionary was Forge's solution to this, both a backend API and several in-game items[3] that allowed manual conversion or behaved as a universal tool. A similar classification system was eventually folded into vanilla as Tags in 1.13 [4]. A new age of modding rode in with 1.4, one where modpacks proliferated, and became increasingly bigger, more complex and better integrated. Version clumping became more noticeable - mods and modpacks began to cluster around specific versions of MC, including 1.7.10. This was often prompted by either a longer-than-usual delay between vanilla releases or a disastrous release that broke major parts of the game, such as 1.8.

So many mods and modpacks cluster around 1.7.10 because Minecraft 1.8 fundamentally changed how block rendering and coordinates were handled by the base game. Each block now required an individual file for each state it could be in; for blocks that previously updated dynamically to react to their contents (like tanks and pipes) this resulted in an astronomical number of permutations that were simply not viable to build and ship. This killed a lot of development inertia and stagnated the modding community as many beloved mods simply could not be updated or were abandoned. Pack makers had to choose between staying on 1.7.10 or give up the last viable version of a core mod for their projects - most chose to stick with 1.7.10. With no modding API and frequent codebase rewrites, official versions break mods regularly like 1.8 did, making modders justifiably reluctant to update their work to the most recent version when it's going to be made useless in short order.

This is one of the main reasons why GT:NH isn't updated for modern MC, and has no plans to do so - the base game is so fundamentally different it would require reworking the last decade of code from the ground up, for minimal improvements and a massive loss of familiarity with the current codebase. Instead the opposite approach has been taken; pulling features and mods from modern builds and backporting them to 1.7.10, which is how GT:NH runs on modern Java and has features that were not historically available at the time.

Instances

An instance is a a set of files that can be used to play a specific version of Minecraft, either vanilla or modded. Usually instances are handled by launchers, because modern instances are not a complete Minecraft .jar. Launchers keep copies of the base Minecraft files and sometimes mod files as well, and swap in the instance at time of play. They also set up instances when they're first installed, making sure each part of the mod(s) or modpack is placed in the right location. Instances also have their own settings for things like Java version, Java arguments, and mod loaders.

Instance folders hold copies of any mods, configuration files, backups, saves (possibly with multiple worlds), screenshots, texture and shader packs, crash reports and logs. Broadly speaking there are four categories of stuff needed to run modded Minecraft - Java, MC itself, mods (modpack/modloader), and the actual player's saved data. The last two are what make up an instance. Because there's a mix of game files and player files in an instance, it's sometimes necessary to go digging in the file structure when manually upgrading or migrating to a different launcher.

Configs

Configs or configuration files are settings that can be adjusted by pack developers or end users. Config files are used for many things. They may allow some parts of a mod to be turned on or off, change properties of individual items, alter recipes, assign data for cross-compatibility and much more. The values in a config file are passed to its parent mod at runtime, and are used to adjust the mod's behavior.

They are stored in text format with extensions like .txt, .ini, .cfg, or .properties. Configs may also be in .xml or .JSON format. Unlike NBT files, configs are (fairly) human-readable without any special decoding, can be opened/changed with a text editor, and may have comment lines (#) explaining what each setting does or what values it can be set to. The variable names in a config file are often descriptive of what that setting will affect. Some, but not all configs can also be changed while Minecraft is running, by opening Esc > Mod Options > choose a mod > Config button. If the Config button is greyed out, that mod's config cannot be changed during gameplay. Shut down the instance and edit the config file directly.

Most configuration files are stored in /your_instance/config/. Some mods have their own sub-folders inside /config/, and folders/files are normally named some variation of the mod's name. There are a few special cases. ServerUtilties and FTBUtilities use /your_instance/local/, while NEI keeps some extra data in /your_instance/saves/NEI/.

Lexicon

This section covers general abbreviations and terms used in computing or Minecraft. Terms exclusive to GT:NH are on the Acronyms page instead.

A

  • Adoptium - an OpenJDK/JRE development group.
  • API - Application Programming Interface. An API is a set of rules that allow multiple programs to pass data to each other they can both understand, even if one program is updated.
  • Architecture - A hardware CPU processor design. Determines what basic instructions the computer can execute natively. Examples include x86_64 (modern 64 bit Intel), amd64 (modern 64 bit AMD) and aarch64 (modern 64 bit ARM processors, such as Apple's M1). Operating system and architecture are shown in the F3 menu when Minecraft is running, on the right side after "OS:". GT:NH will not work (or work very badly) with 32 bit processors, as it needs more RAM than they can normally address.
  • ARR - All Rights Reserved. A "closed source" mod that has not given permission for others to modify or fork its content. GTNH has some ARR mods but no longer adds anything that is ARR, due to the extra difficulty of incorporating these inflexible mods. Notable examples include IC2, Thaumcraft, and ExtraUtilities.
  • ASM - a low-level library capable of modifying running or about to run Java bytecode. Named after the __asm__ codeword from C which let you leave the high level language and program directly in the machine code the CPU runs.

B

  • Backport - the act of bringing fixes or features from a newer version to an older one. GT:NH does this regularly with its forked mods, maintaining and even improving 1.7.10 versions which are usually no longer supported by the original developers (with permission, of course!)

C

  • Client - a computer or software program that can access information from a server, often over a network. A client program may access a server program on the same machine.
  • Console - a text-only window that offers a command line interface for sending instructions. Synonymous with terminal on Unix/Linux systems.
  • CPU - Central Processing Unit, or the brain of the computer. Does lots of math really, really fast.

D

  • DE/DevEnv - Development Environment. Software, hardware and tools that allow the deployment and testing of code. Sometimes used interchangably with IDE.
  • Display name - The common name for an item, block or entity. These do not have to be unique, unlike item/namespace IDs, which do. The display name is what players actually see in any item's tooltip by default.
  • DNS - Domain Name Service. The list that links human-readable domain names to numerical IP addresses.
  • DoS/DDoS - (Distributed) Denial of Service. An attack sent over the internet to overwhelm and shut down a server. [5]

E

  • eMacs - An IDE named as a shortened version of "Editor Macros". A fancy text editor used for programming.

F

  • Forge - modloader used with GT:NH. Cannot load plugins, doesn't scale very well with large numbers of players. Requires a local install of the modpack when running a server.
  • Fork - a derivative copy, usually a program. GT:NH makes extensive use of forked mods to improve compatibility, stability, reduce or fix dependencies, and backport newer features into 1.7.10. This is only possible if the original author(s) have given permission, otherwise a mod is ARR.
  • Framework - A common structure on which a program or application is built. Handles low-level setup and tasks common to the platform. Think of it like a chassis for a car.

G

  • Ghost Block - a block that the server thinks exists, but the client does not. Causes players to get "stuck" in the Schrodinger's block, with a vibrating view. Happens most often with lag between client/server or when breaking blocks at high speed.
  • GPU - Graphics Processing Unit. A computer subsystem specialized in parallel processing which handles video and image rendering.
  • GraalVM - a modern JDK with some advanced features. Used to be quite popular because you could get more modern garbage collection on Java8.

H

  • Hybrid Server - a server that can use both plugins and mods. Often buggier and more difficult to troubleshoot than a standard modded server or plugin server, but can use both types of add-ons. Some plugins and mods may not work at all on a hybrid server. Sponge, Thermos, and Bukkit-Forge are examples of hybrid server types.

I

  • ID - the internal reference for an item, block or entity. This may be an Item ID (numeric) or Namespace ID (string). ID's may also include a metadata suffix.
  • IDE - Integrated Development Environment. A fancy text editor application that assists in writing, building, testing and debugging code. Examples include IntelliJ IDEA, Eclipse and Visual Studio.
  • Instance - A copy of a specific version of Minecraft, with or without specific mods or a modpack. One instance can include multiple world saves. Instances are usually made and managed by a launcher. They hold all the files necessary to run, including configs, mods, the world, player data, etc.
  • IPv4 / IPv6 - Internet Protocol versions 4 and 6. A set of worldwide standards for relaying data over the internet.
  • Item ID - A numerical assignment given to each block or item in Minecraft. Replaced in more modern versions with data values. Every item also has a namespace ID. [6]

J

  • JAR - .jar, or Java ARchive. A data package format containing a manifest plus code, resources, and class files. Sort of like an application bundle, except it can't run without a JRE. The JAR format is simply a ZIP file - you can rename a .jar to .zip and uncompress it to see what is inside (do this on a copy because recompressing it may not work anymore).
  • Java SE - Java, Standard Edition. An umbrella term for the most common JDK and JRE. There are other editions like Micro and Enterprise that have slightly different code bases / abilities, but for the purposes of GT:NH Standard Edition is all that matters. Used interchangeably with "Java".
  • JDK - Java Development Kit. Software that is used to write and test Java code. Includes JRE, but is not needed to play Minecraft or run a server. You can install a JDK to play, the only downside is it will take a bit more space and you may end up developing.
  • JRE - Java Runtime Environment. Software package that includes a JVM, libraries and configuration tools. This is what gets installed on a computer/server to run Minecraft and modded Minecraft. Since it only includes the parts necessary to run a Java program, it is smaller than the equivalent JDK.
  • JSON - Java Script Object Notation. A nested data storage format with fewer options than NBT, but far wider use than just Minecraft. Can be read in a text editor and opened by many web browsers.
  • JVM - Java Virtual Machine. Software just for running Java code / programs. Specific to OS / architecture combinations. i.e. Windows x86-64 or MacOS aarch64. Part of the JRE. The JVM is a "virtual CPU" that runs Java bytecode - it handles the necessary translation to allow the same bytecode to run on multiple platforms.

L

  • LAN - Local Area Network. A group of devices all connected together, in physical proximity. Sends information from device to device directly, commonly with Ethernet cables or Wifi, instead of the wider internet. [7]
  • Launcher - an application that makes it easier to install, manage, backup and run modded instances of Minecraft. Examples include MultiMC, Prism, ATLauncher, and Technic.
  • Library - A set of data, functions or code that can be invoked by other programs. Java uses libraries for common functions, rather than having to write them over and over in each JAR.

M

  • Metadata - Value that defines a subtype of a block/item. For example, all the different kinds of vanilla wood planks share one item ID/namespace ID (0005 or minecraft:planks) and are defined by the number after the colon: 0005:0 is oak, 0005:1 is spruce, 0005:2 is birch, etc. Gregtech makes extensive use of metadata due to having so many materials and variant parts.
  • Mixin - Java library for ASM used to modify bytecode of classes at runtime. This is one of the ways of getting around ARR mods and altering vanilla Minecraft before they load.
  • Mod ID - a string that is unique to each mod, used to generate namespace ID's for its content. This is usually some variation of the mod's common name, but not always. Blood Magic: Alchemical Wizardry uses the mod ID AWWayofTime, while vanilla minecraft uses just minecraft.
  • Modloader - a special type of mod that sets up other mods and makes them work together by adding custom commands, events and schedulers. Modloaders vary in ability, but may also add an API, run a server, or patch Minecraft directly. Examples include Forge, Fabric, Quilt and LiteLoader. Mods may be compatible only with one modloader, or multiple.
  • MP - Multi Player. Minecraft played on a remote server, as opposed to SP or LAN.

N

  • Namespace ID - Sometimes shortened just to ID, a text string the game uses to identify items/blocks, consisting of a mod ID, colon, and item name string. For example, Cobblestone is minecraft:cobblestone. Namespaces may be shared by differentiating items with metadata values; all vanilla planks share the namespace minecraft:planks. Some commands use namespace IDs to define what to affect. Called Resource location in modern Minecraft.[8]
  • NBT - Named Binary Tag[9]. A nested data format for storing values & properties for an item, block or entity in Minecraft. Examples of NBT use include the contents of a chest, mob health/damage, custom item names, enchantments, rotation/position, and much more. Mods can make use of NBT for storing progress or configurable items like Tinker's Construct tools.
  • NPE - NullPointerException. A Java error that happens when programming tries to access or change something that doesn't exist or was improperly defined to begin with. Can be caused by badly written code or data corruption.

O

  • OpenJDK - an open source Java Development Kit.
  • OpenJRE - an open source Java Runtime Environment.
  • OracleJDK - a Java Development Kit published by Oracle corporation.
  • OracleJRE - a Java Runtime Environment published by Oracle coroporation.
  • OreDict/Ore Dictionary - a set of tags that help unify common substitutions for recipes.
  • OS - Operating System. Examples include Linux, MacOS, Windows, Android, iOS, each of which will have multiple versions.

P

  • Plugin - a server-side only extension that adds some kind of functionality to a server. The client does not need to have the plugin for it to work. More limited in scope than mods, typically cannot add textures, models, sounds or game mechanics. Plugin abilities include dynamic permissions, teleporting, factions, mapping, voice chat, pre-generating chunks, custom terrain generation, data logging and anti-griefing tools.
  • Plugin Server - A server that runs vanilla + plugins. Examples include Paper, Bukkit, Spigot. GT:NH cannot run on a plugin server without extensive testing as it requires (many!) mods. The only "supported" plugin server is Thermos, and that has numerous issues. Unless you really need plugin-style features, you're better off running a "vanilla modded" server.

S

  • screen (Linux) - Allows a terminal application to run even after its window is closed. See also: tmux
  • Server - a computer connected to a network that can send and receive information with clients. A computer can be both a server and a client.
  • Shell - interpreter for command line code sent from the terminal/console. Examples include bash (default on Linux), zsh (default on macOS), and cmd (default on Windows).
  • SP - Single Player. Default way of playing Minecraft, vs. LAN and MP.
  • SSH (Secure SHell) - allows remote access to a computer to run a shell (securely). Often used to control a Linux server.

T

  • Terminal (Linux) - a text-only window that offers a command line interface for sending instructions to the shell. On Windows, this is called console instead.
  • tmux - A terminal multiplexer that allows a terminal application to remain running even when the connection is closed. Similar to screen but has additional features.

U

  • UUID - Universally Unique IDentifier. A Java class used to assign a persistent individual ID, which is used to implement features like the Quest Book. Using a non-authorized version of Minecraft breaks UUIDs.

V

  • vi / vim - vi and its descendent "Vi IMproved" are IDEs. A fancy text editor used for programming.