Trinkets Mod

55 Category: API and Library

Discover a new guide for Trinkets Mod Wiki. Trinkets Mod adds a modular accessory system to Minecraft. A position group is a collection of positions for a certain body part. By default, there are 6 position groups (head, chest, legs, feet, hands, backhand) to which positions can be added, but more groups can be added if desired. Trinkets themselves just deployed one tile (chest: cloak) and redeployed elytra to use this tile, mods are responsible for adding any tiles they plan to use.

Trinkets Mod Wiki

Trinkets Mod Wiki

Trinkets is a Minecraft accessory mod built on extreme flexibility and compatibility for developers, while providing an intuitive and accessible interface for users. Trinkets doesn’t enable any slots by default, so it won’t be confusing for users if they don’t. Modpack makers can also tweak the order and appearance of jewelry slots, as well as change where items are equipped to streamline the pack experience.

Trinkets is a huge library with a lot of information to digest and it can be overwhelming. However, there is a large group of people who just want to use it in a very simple way and don’t want to go into all the specifics. Therefore, this tutorial is an easy to get started guide to adding your own jewelry.

Slot Machine

The first important step is to add the locations you want to use. Jewelry data is managed by data packets, so an extremely basic understanding of how it works is fundamental. For a simple mod, you’ll want to choose one of the default locations for your item, although the Additional Jewels documentation can explain how to add custom slots and groupings your own. For this tutorial, feet/aglet will be used. To enable a slot for a player you need to create a file in data/jewels/entities/, the file can be named whatever you want, but it should be named [modid]. json. A simple file to add the aglet location would look like this:

data/trinkets/entities/guidemod.json

When you start the game you will notice that hovering over the pin slot in the inventory pops up that slot group and you can now access the aglet slot. To add an item. The simplest way to register a cheap item is to register an item that extends TrinketItem, like the example below:

 

It will act as a trinket if you register this like any other item when equipped in the aglet slot. Currently since this has not been specified it cannot be equipped anywhere. The jewelry location, by default, validates the items using the item tag, located in data/jewelry/tags/item/[group]/[slot].json. So for this example adding this file works:

data/trinkets/tags/items/feet/aglet.json:

In the game, you will be able to equip an aglet that will help you run a bit faster and provide an extra ring slot if combined with a mod that activates the player’s rings.

Default Slots

Trinkets provides a set of default locations, recommended to be used before custom locations if that makes sense. They are added as data but not enabled for any entities by default and can be deployed more easily to other locations by simply adding them to the entity.

Trinkets API

While most basic interactions with Trinkets, such as adding and configuring locations, will be done with data, there are many features that Trinkets provides in code.

Accessories Components

  • TrinketsApi.getTrinketComponent(LivingEntity) returns one.
  • TrinketComponent optional if available for entity type.

Trinket components contain a lot of data that Trinkets knows about, such as inventory that can be accessed manually (although this is not recommended), access to modifiers, and a number of help methods for using Trinket.

  • {isEquiped} can be called with an item or a predicate and will return whether a jewel of that type is equipped.
  • {getEquipped} returns a list of matching stack and position pairs, called with the same information as {isEquipped}.
  • {getAllEquipped} returns a list of all stack pairs and non-empty positions.
  • forEach can iterate through all slots and stacks for an entity.

Trinkets Predicates

Locations can specify validators, fast-moves, and tooltip predicates for logic, and while Trinkets provides a small amount of base predicates, more code-side predicates can be added with how to use TrinketsApi.registerTrinketPredicate.

Location entity attribute modifier

Trinkets provides a system for modifiers that adjust the number of slots available for certain types of slots. They can add and remove the number of slots that exist of certain types, as low as 0. A helper to conveniently build these is available at SlotAttributes.addSlotModifier.

Trinkets Data Formats

Entity Slots

Entity location files define the locations where an entity is available. By default, entities do not have access to locations, so they need to be added to be used. Simple mods will probably just need to add some default locations to the entities to use and don’t need to create their own slots. The default locations can be found here. These files are loaded from data/jewels/entities/[id].json

Replace

  • Right or wrong. Default is false. When true, the lower-level packet modifications will be replaced. Useful for data packs or mod packs that completely replace location information.

Slot

  • An array of string position IDs in the group/position format.

Entities

  • An array of string entity IDs to apply. player for player.

The following example will add default belt, alet, and ring positions for all players:

Slot card

By default, placements only accept entries in the corresponding location tag. The slot tags are located at data/trinkets/tags/items/[group]/[slot].json and are simple item tags.

Slot machine

Trinkets provides a collection of common locations, including position textures, translation keys, and underlying data. These can be found here. However, Trinkets also supports allowing mod and modpack makers to create their own slots and slot groups for arbitrary use.

Locations require a bit of data

But the first step is the json file

This file is loaded from data/trinkets/slots/[group]/[slot].json.

Please note that all locations are required to be part of a location group, which is automatically generated from the name but may have additional data.

Trinket Predicates

Slot Groups

Update History

Version Date Size
1.19.4 Mar 17, 2023 228.5 KB
1.19.3 Dec 12, 2022 232.0 KB
1.19.2 Jun 8, 2022 226.1 KB
1.19.2 Nov 20, 2022 230.2 KB
1.18.2 Mar 2, 2022 223.8 KB
1.18.1 Dec 1, 2021 212.2 KB
1.17.1 Jul 13, 2021 196.7 KB
1.16.5 Nov 3, 2020 181.5 KB
1.16.3 Oct 10, 2020 181.5 KB
1.16.2 Aug 10, 2020 172.5 KB
1.16.1 Jun 25, 2020 170.6 KB
1.15.2 Apr 7, 2020 144.3 KB
1.15.1 Dec 27, 2019 139.8 KB
1.14.4 Sep 13, 2019 118.8 KB

Trinkets is one of the best mods that MC Wiki has just updated to the Minecraft Mods list

Screenshot

Trinkets Mod Screenshot 1 Trinkets Mod Screenshot 2 Trinkets Mod Screenshot 3 Trinkets Mod Screenshot 4 Trinkets Mod Screenshot 5

Download Links

Download from Curseforge Server

Current Owner:  EmilyPloszaj

Tags