Globox1997 / tiered

https://modrinth.com/mod/tieredz
https://www.curseforge.com/minecraft/mc-mods/tieredz
MIT License
1 stars 15 forks source link

Tiered

Tiered is a Fabric mod inspired by Quality Tools. Every tool you make will have a special modifier, as seen below:

Installation

Tiered is a mod built for the Fabric Loader. It requires Fabric API, AutoTag and LibZ to be installed separately; all other dependencies are installed with the mod.

Customization

Tiered is entirely data-driven, which means you can add, modify, and remove modifiers as you see fit. The base path for modifiers is data/modid/item_attributes, and tiered modifiers are stored under the modid of tiered. Here's an example modifier called "Hasteful," which grants additional dig speed when any of the valid tools are held:

{
  "id": "tiered:hasteful",
  "verifiers": [
    {
      "tag": "c:pickaxes"
    },
    {
      "tag": "c:shovels"
    },
    {
      "tag": "c:axes"
    }
  ],
  "weight": 10,
  "style": {
    "color": "GREEN"
  },
  "attributes": [
    {
      "type": "generic.dig_speed",
      "modifier": {
        "name": "tiered:hasteful",
        "operation": "MULTIPLY_TOTAL",
        "amount": 0.10
      },
      "optional_equipment_slots": [
        "MAINHAND"
      ]
    }
  ]
}

Attributes

Tiered currently provides 3 custom attributes: Dig Speed, Crit chance and Durability. Dig Speed increases the speed of your block breaking (think: haste), Crit Chance offers an additional random chance to crit when using a tool and Durability increases, who would have thought it, the durability of an item.

Types: generic.armor, generic.armor_toughness, generic.dig_speed, tiered:generic.durable, generic.max_health, generic.movement_speed, reach-entity-attributes:reach, generic.luck, generic.attack_damage, tiered:generic.crit_chance, reach-entity-attributes:attack_range, tiered:generic.range_attack_damage

Verifiers

A verifier (specified in the "verifiers" array of your modifier json file) defines whether or not a given tag or tool is valid for the modifier.

A specific item ID can be specified with:

"id": "minecraft:apple"

and a tag can be specified with:

"tag": "c:helmets"

Tiered doesn't provide tags but AutoTag (which is included in this mod) generates several tags which can be found on the repo README. Example tags which AutoTag provides: c:tools, c:pickaxes, c:axes, c:shovels,c:hoes, c:swords, c:armor, c:helmets, c:chestplates, c:leggings, c:boots and several more.

Weight

The weight determines the commonness of the tier. Higher weights increase the chance of being applied on the item and vice versa.

Nbt

Custom nbt can get added via nbtValues, an example can be found below. It supports only string, boolean, integer and double values.\ Caution! Once added nbt keys won't get removed when once applied, just the values can get updated!

"nbtValues": {
  "Damage": 100,
  "key": "value"
}

Tooltip

Since V1.2, custom tooltip borders can get set via a resource pack.

Example:

{ 
    "tooltips": [
        {
            "index": 0,
            "start_border_gradient": "FFBABABA",
            "end_border_gradient": "FF565656",
            "texture": "tiered_borders",
            "decider": [
                "set_the_id_here",
                "tiered:common_armor"
            ]
        }
    ]
}

Reforge

Reforging items to get other tiers can be done at the anvil. There is a slot which is called "base" on the left and a slot called "addition" on the right. The addition slot can only contain items which are stated in the tiered:reforge_addition item tag. The base slot can contain the reforging item material item if existent, otherwise it can only contain tiered:reforge_base_item tag items. The base slot item can get changed via datapack, an example can be found below and has to get put in the tiered:reforge_items folder.
The tiered:modifier_restricted item tag can be used to restrict item modifiers including reforging.

{
  "items": [
    "minecraft:bow"
  ],
  "base": [
    "minecraft:string"
  ]
}

License

Tiered is licensed under MIT. You are free to use the code inside this repo as you want.