Globox1997 / tiered

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

[Suggestion] Compatibility for Trinkets #19

Open RobertHDPotatoes opened 2 years ago

RobertHDPotatoes commented 2 years ago

Would it be possible to add support for the mod Trinkets? Trinkets uses TrinketAttributeModifiers instead of AttributeModifiers, as well as having a slightly different system for slots, so I don't think it's possible to do just by making a custom tier for them. If it is possible through just the datapack system, sorry, but I haven't been able to get it to work

Globox1997 commented 1 year ago

What exactly isn't supported?

RobertHDPotatoes commented 1 year ago

Trinkets adds new data driven slots to the inventory, and equipping a trinket into those new slots only gives stats if the trinket's NBT data uses their special TrinketAttributeModifiers instead of AttributeModifiers (Normal armor and tools use AttributeModifiers). I have tried to add new modifier tiers for Trinkets to no avail, and I think it's due to lack of compatibility due to the slot and NBT data differences, but maybe I just don't understand how to properly add tiers for it?

An example of the /give command to give an item with AttributeModifiers /give @p diamond_sword{AttributeModifiers:[{AttributeName:"generic.attack_damage",Amount:100,Slot:mainhand,Name:"generic.attack_damage",UUID:[I;-1221010,12967,143228,-25934]}]}

And here's an example of the /give command to give an item with the same AttributeModifiers, but it's a trinket from the mod Utilities. /give @p utilities:balloon{TrinketAttributeModifiers:[{Slot:"hand/glove", AttributeName:"minecraft:generic.attack_damage", Name:"minecraft:generic.attack_damage", Amount:100.0, Operation:0, UUID:[I; 42853, 1689024593, -201178, -1559272105]}]}

Globox1997 commented 1 year ago

Tiered uses its own nbt tag to store its relevant information. Check out the nbt information of a normal tiered weapon and try to add it to a trinket.

dragifire commented 1 year ago

Doing this gives the trinket a modifier and changes its name and color, but no stats are given or displayed. This is probably because, as @RobertHDPotatoes mentioned, trinkets only give stats from TrinketAttributeModifiers, but Tiers only provide AttributeModifiers with their tiers. I'm not familiar with how Tiered is coded, but perhaps it is possible to prepend "Trinket" to AttributeModifiers on trinket items with a tier?