Back to mods
Accessory API project artwork

Modrinth · Minecraft mod

Accessory API

Provides an Accessory API for b1.7.3 in the Babric toolchain

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Accessory API release matches b1.7.3?

Updated 2 months ago
Best match for your filters 0.9.1+mcb1.7.3+babric
Game version b1.7.3
Loader babric

Accessory API 0.9.1+mcb1.7.3+babric targets b1.7.3 with babric. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is Accessory API required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release babric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does Accessory API 0.9.1+mcb1.7.3+babric need?

0.9.1+mcb1.7.3+babric on b1.7.3. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add Accessory API without breaking your instance.

Built for Accessory API 0.9.1+mcb1.7.3+babric on b1.7.3. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 0.9.1+mcb1.7.3+babric. It targets b1.7.3 with babric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 0.9.1+mcb1.7.3+babric. It opens that exact file at the source.

About this project

What does Accessory API add?

Side note:

Aether for Station API utilizes this mod!

Accessory API

Using Babric in b1.7.3, this mod provides an API to add additional slots for various items similar to the Trinkets API and Baubles API, with styling inspired by b1.7.3's Aether.

Inventory Preview

Developer Usage

To learn about modding b1.7.3 in the babric toolchain, join The Modification Station!
It's very similar to fabric and fabric-api, but for b1.7.3.

Workspace

Add Accessory API to your build.gradle

repositories {
    maven {
        name = "Jitpack"
        url "https://jitpack.io/"
    }
}

dependencies {
    modImplementation('com.github.matthewperiut:accessory-api:0.5.1') {
        transitive false
    }
}

Recommendation

If you want to quickly see how to use this API, clone the repo (in an ide preferably) and navigate to src/test/java/com/matthewperiut/testmod.
Also view API javadocs / documentation

Implementation

Implement "Accessory" inside your item class
(with STAPI, will work with any API/mixins)

public class ExampleRing extends TemplateItemBase implements Accessory
{
    public Pendant(Identifier identifier)
    {
        super(identifier);
    }
    
    // To define trinket slots that your item can go into:
    @Override
    public String[] getAccessoryTypes(ItemInstance item)
    {
        return new String[]{ "ring" };
        // return new String[0]; // returns no slots
        // return new String[]{ "ring", "cape" }; // can be put in multiple types of slots
        // return new String[]{ "all" }; // can be in any accessory slot
    }

    // other methods you can use, use @Override
    // void tickWhileWorn(PlayerBase player, ItemInstance accessory)
    // void onAccessoryAdded(PlayerBase player, ItemInstance accessory)
    // void onAccessoryRemoved(PlayerBase player, ItemInstance accessory)

    // Rendering
    private YourCustomRenderer renderer;
    @Override
    public Optional<AccessoryRenderer> getRenderer()
    {
        return Optional.ofNullable(renderer);
    }
}

You can choose different types of default accessory types:
"pendant"
"cape"
"shield"
"ring"
"gloves"
"misc"
"all"
or use your own custom accessory type

Accessory Functions Explained

This is called when an accessory slot is clicked on with an item, the item is passed to the function.
This provides the slot information to see if it is compatible with it.
String[] getAccessoryTypes(ItemInstance item)

This is called in the tick function of the associated player, passing the item that is being ticked on which player.
void tickWhileWorn(PlayerBase player, ItemInstance item)

This is called when the inventory relating to the accessory has an item added/removed.
The function provides what player added/removed an accessory as well as the item that was added/removed.
void onAccessoryAdded(PlayerBase player, ItemInstance accessory)
void onAccessoryRemoved(PlayerBase player, ItemInstance accessory)

Provide rendering functions with getRenderer:
public AccessoryRenderer getRenderer()

Creating Accessory Renderer

example:

public class CustomRenderer implements AccessoryRenderer {
    void renderThirdPerson(PlayerBase player, PlayerRenderer renderer, ItemInstance itemInstance, double x, double y, double z, float h, float v)
    {
        // do entity rendering magic
    }

   void renderFirstPerson(PlayerBase player, PlayerRenderer renderer, ItemInstance itemInstance)
   {
       // do entity first person rendering magic
   }
}

Similar usage as EntityRenderers

Built-in AccessoryRenderers:
CapeRenderer
GloveRenderer
NecklaceRenderer
ConfigurableRenderer

Project description from Modrinth.

Pick your setup

Accessory API by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

2 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Accessory API versions and loaders

18 of 18 releases match
Clear filters

Looking for an older file? The official Modrinth project page is in Resources.