Aurilux / Titles

Adds unlockable titles that can be displayed next to your username
GNU General Public License v3.0
4 stars 2 forks source link

Titles should use fully data-driven format & advancements #24

Closed clockler closed 3 years ago

clockler commented 3 years ago

Right now titles are mostly supported by the API, with the data pack seemingly something of an afterthought - not supporting translation keys (and thus genders). It'd be better if the mod used a format more like the actual Minecraft data packs, which would also give space for more rich metadata associated with titles to support i.e. different name relations (prefix/suffix positions, above/below positions), localization, etc. In line with this, it makes sense to have titles driven purely by advancements, as they're robustly supported by data pack modding already, and if modders want to create custom conditions for when titles are granted or control granting specifically from code, they can create custom triggers and conditions for advancements or grant/revoke advancements from the vanilla/forge-supported advancements API.

I'm thinking of something to the effect of:

data/custom/titles/example.json:

{
    "advancement": "minecraft:adventure/root",
    "rarity": "common",
    "variants": {
        "default": {
            "translate": "titles.custom.example.neutral",
            "position": "prefix"
        },
        "male": {
            "translate": "titles.custom.example.male"
        },
        "female": {
            "translate": "titles.custom.example.female"
        }
    }
}

assets/custom/lang/en_us.json:

{
    "titles.custom.example.neutral": "there they are! it's ",
    "titles.custom.example.male": "there he is! it's ",
    "titles.custom.example.female": "there she is! it's "
}

Concerns/clarifications:

This would bring the data pack support up to being a first-class implementation, and possibly even obsolete the need for the API entirely - allowing mod authors to easily and harmlessly include these data files to add support, without having Titles or its API as an actual dependency, by tying granting/revoking of titles to the vanilla advancements system. Moreover, this would allow modpack authors to trivially remove the example titles added by the mod and control exactly what is included in their overall pack - since they could simply use OpenLoader or similar to put blank files in place of the existing titles.

Aurilux commented 3 years ago

Wow! Ok, you've put a lot of thought into this and I greatly appreciate such a detailed response! Making Titles as data driven as possible is a goal of mine, and there are some really good ideas here (such as having some titles require multiple advancements). As for the others, let me explain:

Aurilux commented 3 years ago

Titles have become more data json oriented in the most recent update (3.3.0)