This is a new API I developed today for another project (the "Aether II" mod). Although this was originally intended as a method to implement my Aether main menu into the game without editing base classes, it quickly turned into a project of its own to allow other mods to have their own Main Menu, because I wanted to allow other modders in the community to also make their own without any conflicts.
Allows other mods to create their own Main Menu without editing any base classes.
Allows modders to maintain compatibility with other mods while also having their own unique Main Menu.
Gives the user the freedom to manage and choose which Main Menu they want for their game, without any hassles of choosing a "Final" option.
Has an in-built Jukebox system with a music player. This allows users to play whichever song they like, even their own custom songs!
Modders can choose a specific menu theme song to use for their Main Menu.
Edits no base classes!
The best thing about this API is that it edits no base classes whatsoever, but it does require the Forge API in order to use it. However, since Forge is pretty much standard as of late, I think this is a fair design choice.
HOW IT WORKS:
The screen shown above launches the first time the user starts the game with the API installed.
When a Main Menu is chosen, the choice is saved to a properties file, which on next start up would automatically launch the mod into that chosen Main Menu.
All Main Menus created with this API has a mandatory "Menu List" button (which cannot be overridden) that the user can click on to go back to the above screen and choose a different menu.
The "Menu List" button has configurable positioning for Main Menu creators.
Each menu also has the option to enable a Jukebox button, to easily play music.
I have included three default menu types, including "Minecraft", "Left Minecraft" and "Aether I":
Here is where you can download the API. The Main Menu API requires Forge for 1.5.1, and the API itself is currently only available for Minecraft 1.5.1.
UPDATE - V1.1:
- Fixed a crash that occurred in the menu when your sound was turned off. Crucial update.
In order to install this API, first install Forge into your Minecraft game. Follow the instructions on the Forge thread on how to install Forge.
Once Forge is installed, installing the API is as simple as going into your .minecraft/mods/ folder, and dragging and dropping the "MainMenuAPIv1.0_Beta_MC1.5.1.zip" file you downloaded into it.
Start up your game and you should be greeted with a menu list!
FOR MODDERS USING SRC
After you have decompiled and installed Forge into your MCP workspace, add the files within the "Main Menu API - SRC MC 1.5.1.rar" file into your "MCP/src/minecraft/" folder.
For those who are interested in making their own menu for their mod, here is a guideline you can use to go ahead with creating one:
The structure of the mod works with "Menu Bases". These Menu Bases allow you to utilize the compatibility and functionality of the API. The Menu Base of your mod is what will act as your Main Menu.
To create your own menu, simply create a class the extends the API's "MenuBase" class. In many aspects, the MenuBase class acts like any other GuiScreen class, so if you know anything about how to create GUIs, this should be a fairly easy transition for you.
There are a variety of methods you can override within your Menu Base. Some important ones you might want to consider are:
getName() - This method specifies the name of the Menu Base, and will be displayed in the Menu list at the start of the game. Override this method and return the name of the Menu Base.
getVersion() - This method gives your Menu Base a "version number". This is displayed underneath the menu's name, but it can be other things other than a version number.
getIconPath() - This method specifies the location of your icon image file for display in the menu list.
getJukeboxBackgroundPath() - This method specifies the location of your background image file for rendering the background of the jukebox area.
useJukebox() - This method specifies whether or not your Menu Base enables the Jukebox system/button.
getMusicFileName() - If you would like to specify a specific song for your menu, you can override this method with the name of the song (file extension not needed). If you would like to add your own custom song, place it in /resources/streaming/.
getJukeboxButtonX()/getJukeboxButtonY() - These methods specify the location of the Jukebox button.
getListButtonX()/getListButtonY() - These methods specify the location of the Menu List button.
Please remember when creating your Menu Base to ALWAYS use super for methods such as initGui(), onGuiClosed(), mouseClicked(), drawScreen(), etc. These carry crucial code structures that enable features such as the Jukebox and Menu List. Without using super.initGui() etc etc, your Menu Base may break.
Once you have created your Menu Base and it looks nice and neat, the next thing you must do is register it in your mod class file, perhaps in your load() method. In order to register a menu base, here's an example:
Use that line, except replace "Minecraft" with the name of your Menu Base, and "MenuBaseMinecraft.class" with the class of your Menu Base.
Once this is done, you can start up the game and check out your Menu in the menu list!
Here is a quick example of the layout of a Menu Base:
public class MenuBaseExample extends MenuBase
public void initGui()
super.initGui(); // REMEMBER TO USE SUPER
// ADD BUTTONS HERE
// Example: buttonList.add(new GuiButton(0, 50, 50, 80, 20, "Make A Menu Base");
protected void actionPerformed(GuiButton par1GuiButton)
// EXECUTE CODE BASED ON BUTTON ID
if (par1GuiButton.id == 0)
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
public void drawScreen(int par1, int par2, float par3)
// ADD YOUR RENDERING CODE HERE
super.drawScreen(par1, par2, par3); // REMEMBER TO USE SUPER
public int getListButtonX()
return width - 110;
public int getListButtonY()
public int getJukeboxButtonX()
return width - 24;
public int getJukeboxButtonY()
public String getName()
return "Example Menu";
public String getVersion()
public String getMusicFileName()
public String getIconPath()
Other than that, if you are having any troubles you can look in some of the other Menu Bases provided in the API, such as MenuBaseMinecraft, MenuBaseLeftMinecraft, and MenuBaseAether. They should give you a vague idea of how to make your own Menu Base.
API USAGE FOR MODDERS
Modders are allowed to pre-package this API with their mod, but if you would like to support the API's development, you are free to send your users to download the API at this page instead of pre-packaging it. The decision is up to you! Whether you pre-package the API or not, please include a link to this thread when using this API!