Utilizing Bazel to Create Minecraft Modpacks – Evan Pratten

3 min read


In 2012, I got in to Minecraft mod development, and soon after, put together an almost-plain client-side modpack myself, which mostly included rendering, UI, and quality-of life modifications. Although the modpack was never published or given a name it was maintained for many years until I stopped playing Minecraft in 2016 when I upgraded to Minecraft 1.9. I was so used to the features of this modpack that playing with a pure version of Minecraft didn't feel correct.



Recently, a couple of friends invited me to join their private Minecraft server even though I had not played the game in about four years, I decided to join. This was a mistake on their part, as they now enjoy the pleasure of a player who was 1.6.4 constantly looking at things and asking "What is this and what is it?". I am beginning to accept the new blocks, complex combat system, and bizarre rendering system.



One major thing was still missing, however, where was my modpack? I set out to rebuild my modpack, and finally gave it a name: CorePack. There isn't much changed, most of the same rendering and UI mods are still there along with the identical GLSL shaders and similar textures. Although, I did decide to take an "major step" and switch from the Forge Mod Loader to the Fabric Loader, since I prefer Fabric's API.



Curseforge & Bazel



Curseforge didn't exist back when I was playing regularly. It is a huge improvement over the PlanetMinecraft forums, as curse provides a clean way to get information about published Minecraft mods and has an API! Fortunately, I switched to Fabric and all the mods I needed were accessible through curse. NEI seems to be gone.



CorePack's new version was developed to generate new releases from an CI pipeline when mods are added. This involves programming to pull information about mods and their JAR files using an buildsystem script. Because this project involves dealing with a lot of data from different external sources, I've decided to make use of Bazel, a buildsystem that excels in these types of projects.



Curseforge is a fantastic API to work with mod-data. Minecraftservers.Blog However, @WynPrice (a fellow mod developer) has created Curse Maven which I chose to use instead. Curse Maven is an API that does not require a server, and works exactly like my Ultralight project. Any Curse Maven request for artifacts will be redirected to Curseforge Maven, and served without me having to figure out long-form artifact identifications internally through curse.



Curse Maven makes it easy to load a mod (in this case, fabric-api) into Bazel.



The above snippet uses a Bazel ruleset developed by Square, Inc. called bazel_maven_repository.



Modpack configuration



Two sets of configuration files are needed for my pack to work with MultiMC. The first set informs MultiMC which versions of LWJGL and Minecraft to use. The second set includes the in-game configuration files. A lot of these files contain information that I would like to alter from Bazel during my modpack build step. Starlark's core library contains an action called expand_template.

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up