Mod Gear Core by fzzyhmstrs

  • Gear Core by fzzyhmstrs

    Library mod for the creation of equipment modifiers that can apply entity attributes or track a variety of events like taking damage, killing mobs, and more.
    • 145.82 KB
    • 1.20.1
    • February 11, 2023
    • September 11, 2023
    • API and Library
      Adventure and RPG
      Armor, Tools, and Weapons
      Utility & QoL
    Gear Core
Mod Information
NameGear CoreAuthorfzzyhmstrsDescriptionLibrary mod for the creation of equipment modifiers that can apply entity attributes or track a variety of events like taking damage, killing mobs, and more.
InformationDownloads:
Version: 1.20.1
Size: 145.82 KB
Updated at: September 11, 2023
Created at: February 11, 2023
Tags
API and Library
Adventure and RPG
Armor, Tools, and Weapons
Utility & QoL

Gear Core

Library mod that facilitates the creation of equipment modifiers that can apply standard Minecraft entity attributes or track a variety of events like taking damage, killing mobs, mining blocks, and more. These modifiers aren't affected by grindstones, enchanting tables, or other Minecraft features. These modifiers use the Fzzy Core modifier framework; as such they can be arranged into lineages that pass from one to the next rather than simply stacking numerically.

Current Item Support and Example

Gear Core has built-in modification support for ArmorItem, ToolItem, BowItem, CrossBowItem, ShieldItem, TridentItem, and Trinket, but provides a framework (with the help of Fzzy Core) for making any other type of item modifiable.

Example of Equipment Modifiers in action via Gearifiers:

https://i.imgur.com/aPJanNb.png

Modification Features of an Equipment Modifier

Equipment modifiers can affect the following aspects of equipment:

Attribute Modifiers

Standard Minecraft Attributes can be attached to equipment modifiers. These attributes stack on top of whatever innate attributes the gear has and on top of other modifications.

Durability Modifier

The durability of the gear can be modified using a Fzzy Core PerLvlI instance, which allows for flat changes to durability or percentage changes (or both!).

Post Hit Events

Post-hit event consumers can be added to an Equipment Modifier. These consumers are fired on the postHit method of ItemStack, allowing implementations to perform actions after a player has hit something.

Post Mine Events

Similar to the post-hit events, consumers can also be added for postMine, which fires after a player has successfully broken a block.

On Use Events

Add activated abilities to items! These events fire on the use method, like any right click action. The events only fire if the items innate use isn't successful.

Incoming Damage Modification and Event

Damage modification functions can be attached to equipment modifiers, both allowing for event code upon a player getting damaged, and for damage modification (reduction by 10% of all magic damage, for example).

Mob Kill Events

An event that fires when a player kills a mob, similar structure to all the other events, implementations pass a special consumer to the Modifier for it to process.

Other Modifiers

Other types of modifiers can be attached to equipment modifiers, with a ModifierProcessor available so an implementation can decide what to do with them.

Modifier Rolling System

Gear Core provides a modifier randomization system for adding of random modifiers to certain gear. Check out Gearifiers for a thorough example of this system in action. The short story of how this system works:

Modifier Targets

Gear Core adds EquipmentModifierTargets. These work is a similar manner to EnchantmentTarget in Minecraft, but they are an extendable class rather than an enum. When the modifier rolling system is picking modifiers, it will only pick modifiers from the proper targets.

Weight

Like loot and other things in Minecraft, modifiers can be provided with a weight. This weight works exactly as you'd expect.. every modifier who matches up to the target is put into a pool X times based on it's weight, and the total pool is used for random modifier rolls.

Rarity

Modifiers can be given a rarity. This is an enum that defines the formatting of the modifier on the item tooltip, with the different rarities providing different colors (and some bold)

Rarity Format
Legendary Gold, Bold
Epic Light Purple
Rare Aqua
Uncommon Dark Green
Common Gray
Bad Dark Red
Really Bad Dark Red, Bold

Toll

Each modifier takes a certain toll on the rolling pool. The pool starts with a certain amount of toll it can spend, with each modifier added spending it's toll out of that pool until there isn't enough left for the next roll to succeed. The default toll is 5, with a default pool of about 5.75 on average.

Providing different tolls allows for fine tuning of selection probability.

Persistence and Availability for Rolling

A modifier can be created to be persistent, which prevents it from being removed on a reroll. This might be used for "innate" modifiers or for "cursed" modifiers.

Modifiers can also be marked as unavailable for random selection. This might be used, again, for "innate" modifiers that aren't part of a random chance system but are simply provided with every instance of the item.