Gear Core
The Gear Core mod is a powerful library for creating and customizing equipment modifiers in Minecraft. With it, you can add various bonuses to items, track different game events, and create unique mechanics for equipment.
Equipment Set System
Starting from version 0.3.0, the mod introduced the ability to create equipment sets with unique bonuses through datapacks. You can develop RPG-style set bonuses for any item combinations. Sets support tiers, custom formatting, and can be applied to almost any items in the game.
Tooltips for set bonuses are automatically displayed in relevant sets, and there is also EMI support for viewing all sets, their items, and bonus descriptions.
The set system supports attributes (including custom ones) and equipment modifiers. Currently, only attributes can be added exclusively through datapacks, while modifiers require prior creation in code before being used in a set.
Example JSON for creating a set:
{
"name": "set.imbued_gear.lich_kings",
"active_formatting": [
"GREEN",
"BOLD"
],
"items": {
"tag": "imbued_gear:lich_kings_gear"
},
"bonuses": {
"2": {
"name":"lich_kings_amplifier",
"attribute": "amethyst_core:spell_amplifier",
"amount": "2.0",
"operation": "ADDITION"
},
"4": {
"name":"lich_kings_duration",
"attribute": "amethyst_core:spell_duration",
"amount": "0.15",
"operation": "MULTIPLY_TOTAL"
},
"5": "imbued_gear:horde_master"
}
}
Equipment Modifiers
Gear Core provides a framework for creating equipment modifiers that can apply standard Minecraft entity attributes or track various events such as taking damage, killing mobs, mining blocks, and much more. These modifiers are not affected by grindstones, enchanting tables, and other standard Minecraft features.
The modifiers use the Fzzy Core framework and can be organized into lineages, passing from one to another rather than simply stacking numerically.
Supported Items
The mod has built-in modification support for ArmorItem, ToolItem, BowItem, CrossBowItem, ShieldItem, TridentItem, and Trinket, but also provides a framework (with the help of Fzzy Core) for creating modifiable items of any other type.
Modifier Capabilities
Attribute Modifiers
Standard Minecraft attributes can be attached to equipment modifiers. These attributes stack on top of the gear's innate attributes and other modifications.
Durability Modifiers
Equipment durability can be modified using a PerLvlI instance from Fzzy Core, allowing for both flat durability changes and percentage changes (or both simultaneously).
Post-Hit Events
Post-hit event handlers can be added to equipment modifiers. These handlers are triggered when the postHit method of ItemStack is called, allowing actions to be performed after a player has hit something.
Post-Mine Events
Similar to post-hit events, handlers can be added for postMine, which triggers after a player successfully breaks a block.
On-Use Events
Add activated abilities to items! These events trigger when the use method is called, like any right-click action. The events only trigger if the item's innate use is not successful.
Incoming Damage Modification and Events
Damage modification functions can be attached to equipment modifiers, allowing both code execution when a player takes damage and damage modification itself (for example, reducing all magic damage by 10%).
Mob Kill Events
An event that triggers when a player kills a mob, with a structure similar to all other events.
Random Modifier System
Gear Core provides a modifier randomization system for adding random modifiers to specific equipment.
Modifier Targets
The mod adds EquipmentModifierTargets, which work similarly to EnchantmentTarget in Minecraft but are an extendable class rather than an enumeration. When selecting modifiers, the system will only choose modifiers from appropriate targets.
Weight
As with loot and other systems in Minecraft, modifiers can be assigned a weight. This weight works exactly as you'd expect - each modifier matching the target is placed into a pool X times based on its weight, and the total pool is used for random modifier rolls.
Rarity
Modifiers can be assigned a rarity. This enumeration determines the modifier's formatting in the item tooltip, with different rarities providing different colors (and some with bold text).
Toll
Each modifier requires a certain toll from the roll pool. The pool starts with a specific amount of available toll, with each added modifier spending its toll from this pool until there isn't enough left for the next successful roll.
Persistence and Roll Availability
A modifier can be created as persistent, preventing its removal on a reroll. This might be used for "innate" modifiers or "cursed" modifiers.
Modifiers can also be marked as unavailable for random selection. This might be used, again, for "innate" modifiers that are not part of a random chance system but are simply provided with every item instance.