Steven’s API Mod shares common code, utility classes, and a unified creative tab across connected mods. This library mod acts as a required prerequisite so sub-mods reuse the same base code with no extra copies. Through a compact public API, it collects items from separate mods and shows them together inside one creative tab. Other projects can link this mod as a source subproject or as a local JAR file, and it runs on both client and server sides.

Steven's API Mod

Features:

  • Shared Creative Tab: Adds a dedicated creative tab with the ID steven_tab so connected sub-mods display their items in one place.
  • Common Code Library: Shares reusable utility classes and common code across dependent mods as a single required prerequisite.
  • Collects contributed ItemStack entries from multiple sub-mods into the shared creative tab.
  • Loads with AFTER dependency ordering and runs on both the client and server sides (BOTH).
  • Links into other mod projects either as a Gradle source subproject or as a local JAR inside the libs/ folder.

Public API:

  • ApiTabContributors.register(Supplier): Registers a supplier of item stacks to show inside the steven_tab creative tab.
  • ApiTabContributors.collectAll(): Collects all contributed item stacks from registered sub-mods for internal use.

How to Use:

Source Subproject Setup:

  1. Open settings.gradle and point Gradle to the local API project folder so it loads as a subproject:
    include ':steven_mod_api'
    project(':steven_mod_api').projectDir = file('../Steven_Mod_API')
  2. Add the project(':steven_mod_api') dependency entry in build.gradle so your sub-mod compiles against the shared classes.

Local JAR Setup:

  1. Place the built API JAR file inside your project’s libs/ folder.
  2. Add the artifact coordinate blank:steven_mod_api:1.0.0 to your build.gradle dependencies block.
  3. Declare steven_mod_api as a required dependency inside your mod metadata file (mods.toml) so the game loads the API before your sub-mod:
    [[dependencies.your_mod_id]]
        modId = "steven_mod_api"
        type = "required"
        versionRange = "[1.0.0,)"
        ordering = "AFTER"
        side = "BOTH"

Creative Tab Item Registration:

  1. Call ApiTabContributors.register(...) in your sub-mod and return a list of ItemStack entries; every registered item appears inside the steven_tab creative tab:
    ApiTabContributors.register(() -> List.of(
        new ItemStack(MyItems.MY_ITEM.get())
    ));

Requirements:

Steven’s API Mod Download Links

For Minecraft 1.21.1, 1.21

Click to rate this post!
[Total: 0 Average: 0]
QUICK MINECRAFT SURVEY · ONE TAP
Mods & Modpacks

How do you feel about 'expert' modpacks that change recipes to be much harder and interconnected?

38 responses · See the full results →