
[Feature Request] custom nbt support
BredyAK opened this issue ยท 0 comments
hi there, i want to request for a feature that is adding the mod's ability to identify item's nbt and is value.
currently the config file is:
#Define rarity for each item in this list to common rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_common_list = []
#Define rarity for each item in this list to uncommon rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_uncommon_list = []
#Define rarity for each item in this list to rare rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_rare_list = []
#Define rarity for each item in this list to epic rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_epic_list = []
#Define rarity for each item in this list to legendary rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_legendary_list = []
#Define rarity for each item in this list to unique rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_unique_list = []
#Define rarity for each item in this list to mythic rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_mythic_list = []
#Define rarity for each item in this list to god rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_god_list = []
i've been using another mod called Legendary Tooltips before, and the mod provides a same way to render item's tooltip styles. it could identify item's different datas, just like this:
# Entry types:
# Match all - Specifying just an asterisk (*) will match all items. Examples: "*"
# Item ID - Use item ID to match single items. Must include mod name for modded items. Examples: "minecraft:stick", "iron_ore", "spoiledeggs:spoiled_egg"
# Tag - $ followed by tag name to match all items with that tag. Examples: "$forge:stone", "$planks"
# Mod name - @ followed by mod identifier to match all items from that mod. Examples: "@spoiledeggs"
# Rarity - ! followed by item's rarity to match all items with that rarity. This is ONLY vanilla rarities. Examples: "!uncommon", "!rare", "!epic"
# Item name color - # followed by color hex code, to match all items with that exact color item name. Examples: "#23F632"
# Display name - % followed by any text. Will match any item with this text (case-sensitive) in its tooltip display name. Examples: "%Netherite", "%Uncommon"
# Tooltip text - ^ followed by any text. Will match any item with this text (case-sensitive) anywhere in the tooltip text (besides the name). Examples: "^Legendary"
# NBT tag - & followed by tag name and optional comparator (=, >, <, or !=) and value, in the format <tag><comparator><value> or just <tag>. Examples: "&Damage=0", "&Tier>1", "&map!=128", "&Enchantments"
# Negation - ~ followed by any selector above. This selector will be negated, matching every item that does NOT match the selector. Examples: "~minecraft:stick", "~!uncommon", "~@minecraft"
# Combining selectors - Any number of selectors can be combined by separating them with a plus sign. Examples: "minecraft:diamond_sword+&Enchantments", "minecraft:stick+~!common+&Damage=0"
[client.definitions]
level0_entries = ["*"]
level1_entries = ["!uncommon"]
level2_entries = ["!rare"]
level3_entries = ["!epic"]
level4_entries = ["&custom_rarity=legendary"]
level5_entries = ["&custom_rarity=mythical"]
level6_entries = []
level7_entries = []
level8_entries = []
level9_entries = []
level10_entries = []
level11_entries = []
level12_entries = []
level13_entries = []
level14_entries = []
level15_entries = []
# Enter blacklist selectors here using the same format as above. Any items that match these selectors will NOT show a border.
blacklist = []
# Set border priorities here. This should be a list of numbers that correspond to border levels, with numbers coming first being higher priority.
# Optionally, -1 can be inserted to indicate relative priority of data and api-defined borders. If you don't know what that means, you don't need to worry about it.
[client.priorities]
priorities = [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
so, if i write like:
[client.definitions]
level0_entries = ["*"]
level1_entries = ["!uncommon"]
level2_entries = ["!rare"]
level3_entries = ["!epic"]
level4_entries = ["&custom_rarity=legendary"]
level5_entries = ["&custom_rarity=mythical"]
level6_entries = []
level7_entries = []
level8_entries = []
level9_entries = []
level10_entries = []
level11_entries = []
level12_entries = []
level13_entries = []
level14_entries = []
level15_entries = []
# Set border priorities here. This should be a list of numbers that correspond to border levels, with numbers coming first being higher priority.
# Optionally, -1 can be inserted to indicate relative priority of data and api-defined borders. If you don't know what that means, you don't need to worry about it.
[client.priorities]
priorities = [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
then all vanilla's uncommon items will have a yellow uncommand tooltip, all items which nbt tag custom_rarity
set to legendary
will be rendered with a golden legendary tooltip.
so, there is my suggestion, you could add these functions to Custom Rarity too. and users could write like this:
#Define rarity for each item in this list to common rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_common_list = ["*"]
#Define rarity for each item in this list to uncommon rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_uncommon_list = ["!uncommon"]
#Define rarity for each item in this list to rare rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_rare_list = ["@spoiledeggs"]
#Define rarity for each item in this list to epic rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_epic_list = ["%epic"]
#Define rarity for each item in this list to legendary rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_legendary_list = ["&parent_nbt_key.sub_nbt_key.custom_rarity=legendary"]
#Define rarity for each item in this list to unique rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_unique_list = ["^Unique"]
#Define rarity for each item in this list to mythic rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_mythic_list = []
#Define rarity for each item in this list to god rank, must be a resource location name !
#If any item is already defined in another list, it will use the highest rarity first !
item_rarity_god_list = []
note: i use a dot symbol (.
) to split the parent nbt keys and sub nbt keys.
thank you for bringing us this great mod!!!