TheDeathlyCow / frostiful

A Vanilla+ Snow & Frost Update Survival Experience for Minecraft
GNU Lesser General Public License v3.0
16 stars 8 forks source link

Data-Driven Item Attribute Modifiers #17

Closed TheDeathlyCow closed 1 year ago

TheDeathlyCow commented 1 year ago

Implements #16 by allowing any item to be configured with any attribute modifier via a datapack.

Item attribute modifiers are specified in the directory data/[namespace]/frostiful/item_attribute_modifiers in a JSON file with the following format:

{
    "item": "Resource Location of Item to modify",
    "slot": "The string name of the slot to apply this to",
    "attribute_modifiers": [ 
        {
            "attribute": "Resource Location of the attribute to use for the modifier",
            "modifier": {
                "uuid": "A string UUID of the modifier",
                "operation": "The string name of the operation to use",
                "value": "The double value of the modifier",
                "name": "An optional string containing the name of the modifier. Defaults to the empty string".
            }
        }
    ]
}

The attribute_modifiers field may either be specified as a JSON list or a JSON object

ryleu commented 1 year ago

This seems like an excellent solution. I'll update my modpack with data packs to make use of this change once it's merged.

ryleu commented 1 year ago

Is there an ETA for a Modrinth release for this?

TheDeathlyCow commented 1 year ago

I can put up a release tomrrow.