IconButtons API

Quick rating

IconButtons API

No reviews yet

API for easily adding buttons to the Icon Buttons row in the title menu and pause menu

API/Library
Mod Loaders
Fabric
Minecraft
26.2

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Unsupported

About

Project Details

Type
Mod
License
MIT License
Latest Version
IconButtonsApi-1.0.1+mc-26.2.jar
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

IconButtons API

API for easily adding buttons to the Icon Buttons row in the title menu and pause menu

preview

Implementation

1. Configure build.gradle

repositories {
    maven {
        url "https://api.modrinth.com/maven"
    }
}
dependencies {
    implementation "maven.modrinth:iconbuttonsapi:${project.iconbuttonsapi_version}+mc-${project.minecraft_version}"
}

2. Configure gradle.properties

Add the following lines to your gradle.properties file and replace the values with your target versions:

iconbuttonsapi_version=1.0.0

3. Configure fabric.mod.json

Don't forget to declare the dependency in your fabric.mod.json so Fabric Loader can verify it at runtime:

"depends": {
    ...
    "iconbuttonsapi": ">=1.0.0"
}

Usage

The main entry point of the API is the IconButtons class. It provides methods to easily add any AbstractWidget (like buttons, sliders, etc.) to the Minecraft Title Screen or Pause Menu rows.

You can register buttons to stay visible permanently or control their visibility dynamically using a BooleanSupplier.

Example

public class ExampleModClient implements ClientModInitializer {  
    public static final String MOD_ID = "iconbuttonsapi";  
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
    public static boolean willShow = true;

    @Override
    public void onInitializeClient() {
        Button buttonHi = Button.builder(
                Component.literal("hi"),
                b -> {
                    LOGGER.info("Hi!");
                }
        ).size(IconButtons.getButtonWidthAndHeight(), IconButtons.getButtonWidthAndHeight()).build();
        Button buttonToggleShow = Button.builder(
                Component.literal("T"),
                b -> {
                    willShow = !willShow;
                }
        ).size(IconButtons.getButtonWidthAndHeight(), IconButtons.getButtonWidthAndHeight()).build();

        IconButtons.addTitleScreenButton(buttonHi, () -> willShow);
        IconButtons.addPauseScreenButton(buttonHi, () -> willShow);

        IconButtons.addTitleScreenButton(buttonToggleShow);
        IconButtons.addPauseScreenButton(buttonToggleShow);
    }
}

Features

  • Automatic Positioning: You don't need to specify coordinates (X and Y) for your widgets. The API calculates and applies positioning automatically, arranging your buttons into a neat row.
  • Size: It is recommended to use IconButtons.getButtonWidthAndHeight() (returns 20) for the correct size to ensure your icons fit perfectly alongside vanilla icons.

IconButtons API

API for easily adding buttons to the Icon Buttons row in the title menu and pause menu

preview

Implementation

1. Configure build.gradle

repositories {
    maven {
        url "https://api.modrinth.com/maven"
    }
}
dependencies {
    implementation "maven.modrinth:iconbuttonsapi:${project.iconbuttonsapi_version}+mc-${project.minecraft_version}"
}

2. Configure gradle.properties

Add the following lines to your gradle.properties file and replace the values with your target versions:

iconbuttonsapi_version=1.0.0

3. Configure fabric.mod.json

Don't forget to declare the dependency in your fabric.mod.json so Fabric Loader can verify it at runtime:

"depends": {
    ...
    "iconbuttonsapi": ">=1.0.0"
}

Usage

The main entry point of the API is the IconButtons class. It provides methods to easily add any AbstractWidget (like buttons, sliders, etc.) to the Minecraft Title Screen or Pause Menu rows.

You can register buttons to stay visible permanently or control their visibility dynamically using a BooleanSupplier.

Example


public class ExampleModClient implements ClientModInitializer {  
    public static final String MOD_ID = "iconbuttonsapi";  
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
    public static boolean willShow = true;

    @Override
    public void onInitializeClient() {
        Button buttonHi = Button.builder(
                Component.literal("hi"),
                b -> {
                    LOGGER.info("Hi!");
                }
        ).size(IconButtons.getButtonWidthAndHeight(), IconButtons.getButtonWidthAndHeight()).build();
        Button buttonToggleShow = Button.builder(
                Component.literal("T"),
                b -> {
                    willShow = !willShow;
                }
        ).size(IconButtons.getButtonWidthAndHeight(), IconButtons.getButtonWidthAndHeight()).build();

        IconButtons.addTitleScreenButton(buttonHi, () -> willShow);
        IconButtons.addPauseScreenButton(buttonHi, () -> willShow);

        IconButtons.addTitleScreenButton(buttonToggleShow);
        IconButtons.addPauseScreenButton(buttonToggleShow);
    }
}

Features

  • Automatic Positioning: You don't need to specify coordinates (X and Y) for your widgets. The API calculates and applies positioning automatically, arranging your buttons into a neat row.
  • Size: It is recommended to use IconButtons.getButtonWidthAndHeight() (returns 20) for the correct size to ensure your icons fit perfectly alongside vanilla icons.

Screenshots

Gallery

  • Example Buttons 2
    Example Buttons 2
  • Example Buttons
    Example Buttons

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Total Downloads
CurseForge
<1,000
Modrinth
<1,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works