Closed clockler closed 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:
Titles have become more data json oriented in the most recent update (3.3.0)
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
:assets/custom/lang/en_us.json
:Concerns/clarifications:
custom:example
to refer to this title, for commands or other purposes. A title defined by a mod might be at the datapack location ofdata/tetra/titles/hammerer.json
instead, and thus have the resource locationtetra:hammerer
. Similarly, if it's in a folder it should follow the normal Minecraft conventions (data/custom/titles/sub/directory/title.json
->custom:sub/directory/title
)text
as the key instead oftranslate
and write directly, which is in line with the Minecraft vanilla raw JSON text components (though a full implementation of them is both overkill and not applicable for titles).variants.female.position
) use that value from the default variant - so in the above example, if the player has their own gender set to female, it will use theposition
key from the default variant, i.e. all variants here use the same position but don't actually have toThis 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.