A mod to add tooltip and jei information to items with a datapack
You can find examples below, the same examples are available in the example_datapack folder.
NBT filtering only works for tooltips, in JEI the item only uses that data to show.
The json text can for example be generated with the help of minecraftjson.com or minecraft.tools
The SNBT part of the item can be written/edited with SNBT Editor
For tooltips you can add a exclude_nbt, it will exclude any item matching that nbt. It can be combined with the normal nbt.

{
"items": [
"minecraft:diamond",
{
"item": "minecraft:coal",
"nbt": {
"display": {
"Name": "{\"text\":\"Compact Coal\"}"
}
},
"exclude_nbt": {
"display": {
"Name": "{text:\"Infinity Diamond\"}"
}
}
}
],
"tooltips": [
{"text":"This ", "extra": [{"text":"is an","underlined":true},{"text":" Example ","color":"green"},{"text":"Tooltip","bold":true,"color":"green"}]},
["",{"text":"This "},{"text":"is another ","italic":true,"color":"red"},{"text":"way to ","strikethrough":true},{"keybind":"key.attack"},{"text":" do it","bold":true,"underlined":true,"color":"dark_green"}],
{"translate":"item.minecraft.diamond","bold":true},
"No special style also works",
"§4Legacy coloring §aalso works"
]
}{
"items": [
"minecraft:diamond",
{
"item": "minecraft:coal",
"nbt": {
"display": {
"Name": "{\"text\":\"Compact Coal\"}"
}
}
}
],
"infos": [
{"text":"This ", "extra": [{"text":"is an","underlined":true},{"text":" Example ","color":"green"},{"text":"Tooltip","bold":true,"color":"green"}]},
["",{"text":"This "},{"text":"is another ","italic":true,"color":"red"},{"text":"way to ","strikethrough":true},{"keybind":"key.attack"},{"text":" do it","bold":true,"underlined":true,"color":"dark_green"}],
{"translate":"item.minecraft.diamond","bold":true},
"No special style also works",
"§4Legacy coloring §aalso works"
]
}