Waila NBT is a mod to show player defined specific NBT info on Waila HUD.
Waila NBT is a Client-Side addon for Waila. And In-Game NBTEdit (1.7.10 version)is needed to look up NBT data structure.
First, drop the jar file into mods and start game.
A configuration folder as well as a empty file “default.json” will be generated in your config folder. The mod is useless until you put right config in it.
The config file is in JSON format looks like this:
{
"Holding Item Name": {
"Tile Entity ID 1": {
"Tag Name 1": "Display Name 1",
"Tag Name 2>>>Tag Name 3": "Display Name 2"
},
"Tile Entity ID X": {
},
"Holding Item Name X": {}
}
}
This configuration means, when player holding an item named “Holding Item Name”, and point cursor at aTile Entity with ID “Tile Entity ID 1″, “Value of Tag Name” will be shown, and “Display Name 1″is the name that will represent “Value of Tag Name” in Waila HUD.
“Tag Name 2>>>Tag Name 3″ means display the value of “Tag Name 3″ in the NBT Tag Compound named “Tag Name 2″. That’s somehow similar to a sub folder. Use “>>>” to separate to name if “Tag Name 3″ is inside “Tag Name 2″. “>>>” should only be used under this sub folder condition.
As for TagList, you can use number. e.g. Use "Items>>>2>>Count" to access the highlighting field("Count: 32").
“Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1″ support regular expression, so some special characters like “|”(pipe) need a “\”(backslash) before it. e.g: “BuildCraft|Transport” must be written as “BuildCraft\|Transport”.
Let’s take a living example.
Blood Altar is a basic block of Blood Magic. It can store “Life Essence” and transmute items.
When pointing at it, run command “/nbtedit”
And here is what the tool(Divination Sigil) from blood magic says.
Now we know the ID of this block is “containerAltar“, and we guess that the “Amount” is the “Current Essence” and “capacity” is “Capacity”.
The target is, when holding the Divination Sigil, we can directly read the “Current Essence” and “Capacity” from the Waila HUD rather than a right click.
Hold the Divination Sigil and run command “/wnn” (stand for Waila NBT Name). The identify name “AWWayofTime:divinationSigil” of it will be shown in chat window.
For Inventory Tweak user
If you have Inventory Tweak installed, you can also see the name on the item tooltips, by allowing advanced tooltips(hotkey: F3+H).
So we write following content to default.json. (Or if you wanna keep them in order, create a “bloodmagic.json” and write in it instead.)
“.*” is an regular expression matches all string. Note it also matches hand without holding anything. Because holding nothing equals holding an item named “”(empty string).
And don’t forget run command “/wnr” to reload configuration.
Now point at Daybloom and it should work.
Part 2. Mobs(Entity)
Waila NBT also works on entity(mobs, etc.).
Just write configs and change “Tile Entity ID” to “Entity ID”, which can be known by command “/wne”(stand for Waila NBT Entity).
And you can use “/nbtedit” to see NBT data structure of an entity too.
Following is the example config file for the picture of sheep above.
WailaNBT works on item too. And will show information on tool-tip.
There are no method to look up the NBT data structure of an item, so a chest is needed. Put item in a chest and run command “/nbtedit”. The part surrounded with a blue border is the NBT structure of the item.
You need to change “Holding Item Name” to “tooltip” and change “Tile Entity ID” to “Item Name”, which cant be get by the command “/wnn”.
Following is the example config file for the picture of notch’s head above.
Displayed value can be modify by using printf style formatter or JavaScript and can be decorate with color and font style.
Don't forget to add the Holding Item and Tile Entity ID content. This part only focus on "Tag Name 1": "Display Name 1" content.
Printf style formatter
e.g. "Owner>>>Name":"This is %s's head!" will get the effect below.
You may find "%.2f" useful. This will force it show 2 decimal places.
JavaScript
You may wanna do more than format a string, like divide ticks by 20 to show in seconds. JavaScript modifier is for you.
Let's take furnace as an example.
To show the burn time in seconds, use this code below
"BurnTime": "function p(v){var r = (v/20);return 'Burn time left: '+r.toFixed(1)+' seconds'}"
Amazing!
"function p(v){}" is forced if you want to you JavaScript to modify the value. that's the basic function to run. "v" is the value read according to Tag Name and you can do anything you like in JavaScript with it. And don't forget to return what you want to display.
It's tricky sometime when you look up ID in an inventory. It's a number and hard to know what actually is. When encounter this problem, use a pre-defined object named "names".
You can use name['id'] to get the name of the numeric id. Note it can only handle limited localized name now.
e.g. If you want to display the first item name in a hopper. Write below in the config file:
16 colors and bold/strike/underline/italic can be used to decorate displayed text. you can also use some text to make the text right/center aligned or use tab to make things neat.
"\u00A4\u00A4a" works as tab
"\u00A4\u00A4b" works as right-aligned
"\u00A4\u00A4c" works as center-aligned
The default style is "key tab+right-aligned+white value"
e.g."BrewTime": "Brew time left \u00A4\u00A4a\u00A4\u00A4b\u00A7f%.0f ticks" works as below.
Notice
This mod is over powered and may destroy experience in survival mode. It’s generally written for testing purpose. Use it on server without permission may be considered as cheating.
Holding nothing equals holding an item named “”(empty string).
If display name is not provided (like “Amount”:””), the tag name(“Amount”) will be used.
If there are two config contains same “Tile Entity ID” and their “Holding Item Name” is same, one of “Tile Entity ID” will be ignored.
Folders in config/WailaNBT will be ignored.
Planning Feature
Support for items dropped on ground.
Allow hide type/part of info according to config, maybe keys
Better distribute and control pre-config files
Support download config from server side to make it not a cheat mod for SMP
More complex match method
Thanks
Prof Mobius for bring us Waila.
Pahimar for teaching me basic modding.
Davidee for bring us In-Game NBTEdit, and bjbinc for 1.7.10 port
ViKaleidoscope for Simplified Chinese localization and many config files.
Fixided for tutorial editing advice.
License
Source code of this mod can be found here: https://github.com/exzhawk/wailanbt
You can include it in modpacks and redistribute binary files. But a notice in this post and keeping a link to this post will be appreciated.
Your instructions are crystal clear and easy to follow too
However, if you wouldn't mind, could you replace this....
This configuration means, when player holding an item named “Holding Item Name”, and point cursor at aTile Entity with ID “Tile Entity ID 1″, Waila HUD will display “Display Name 1, value of Tag Name 1″. “Tag Name 2>>>Tag Name 3″ means display the value of “Tag Name 3″ in the NBT Tag Compound named “Tag Name 2″.
“Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1″ support regular expression, but the regex must not contains “>>>”.
...with mines instead?
This configuration means:
When player is holding an item named “Holding Item Name”,
and points the cursor at a Tile Entity with ID “Tile Entity ID 1″,
Waila HUD will display "Value of Tag Name 1, Display Name 1″. - Noob translation:
"Value of Tag Name 1" is What you want to be shown.
"Display Name 1" is the name that will represent "Value of Tag Name 1" in Waila's HUD.
“Tag Name 2>>>Tag Name 3″ means to display the value of “Tag Name 3″ in the NBT Tag Compound named “Tag Name 2″. - Noob translation:
~ A subfolder:
~ Use?: If a Tag Name is inside a Tag Name.
~ Basically: "Tag Name 3" is in "Tag Name 2"
“Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1″ support regular expression, but the regex must not contain “>>>”.
- Noob translation:
~ “Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1" does not contain ">>>"
~ Only “Tag Name 2>>>Tag Name 3″ contains ">>>"
This is my edit to your current instructions.
I have no knowledge of coding,
so what I edited is what I understood from your current instructions.
So please fix any mistakes I made.
This is my edit to your current instructions.
I have no knowledge of coding,
so what I edited is what I understood from your current instructions.
So please fix any mistakes I made.
update to 1.3
Now support Mobs(Entity) and Item(Tool tips)!
Changelog:
support items tooltips
add /wne command to show entity id
support entity
more debug info in chat
Awesome work. I may start digging into this for addition into my modpack. I have been wanting something to view effective armor at a glance as many mods armor goes over what is displayed on the screen hud
Waila NBT development stopped. Visit http://blog.exz.me/omni-ocular/
Description
Waila NBT is a mod to show player defined specific NBT info on Waila HUD.Waila NBT is a Client-Side addon for Waila. And In-Game NBTEdit (1.7.10 version)is needed to look up NBT data structure.
Examples (with config files)
Download .json file and put in config\WailaNBT folder and its ready to use.Please share your config!
More config files can be found at https://github.com/exzhawk/wailanbt/tree/master/eclipse/config/WailaNBT
Blood magic (Holding Divination Sigil)
BuildCraft (Holding BC Wrench) by ViKaleidoscope
Ender IO (Holding Yeta Wrench) by ViKaleidoscope
Thaumcraft (Holding Wand) by ViKaleidoscope
Industrial Craft 2 (Holding anything is fine) by ViKaleidoscope
Thermal Expansion (Holding Crescent Hammer) by ViKaleidoscope
Witchery (Holding anything is fine) by ViKaleidoscope
Tutorial
Blood Magic by WayofTime and Botania by Vazkii are used as examples for tutorial.Part 1. Blocks(Tile Entity)
A configuration folder as well as a empty file “default.json” will be generated in your config folder. The mod is useless until you put right config in it.
The config file is in JSON format looks like this:
This configuration means, when player holding an item named “Holding Item Name”, and point cursor at aTile Entity with ID “Tile Entity ID 1″, “Value of Tag Name” will be shown, and “Display Name 1″is the name that will represent “Value of Tag Name” in Waila HUD.
“Tag Name 2>>>Tag Name 3″ means display the value of “Tag Name 3″ in the NBT Tag Compound named “Tag Name 2″. That’s somehow similar to a sub folder. Use “>>>” to separate to name if “Tag Name 3″ is inside “Tag Name 2″. “>>>” should only be used under this sub folder condition.
As for TagList, you can use number. e.g. Use "Items>>>2>>Count" to access the highlighting field("Count: 32").
“Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1″ support regular expression, so some special characters like “|”(pipe) need a “\”(backslash) before it. e.g: “BuildCraft|Transport” must be written as “BuildCraft\|Transport”.
Let’s take a living example.
Blood Altar is a basic block of Blood Magic. It can store “Life Essence” and transmute items.
When pointing at it, run command “/nbtedit”
And here is what the tool(Divination Sigil) from blood magic says.
Now we know the ID of this block is “containerAltar“, and we guess that the “Amount” is the “Current Essence” and “capacity” is “Capacity”.
The target is, when holding the Divination Sigil, we can directly read the “Current Essence” and “Capacity” from the Waila HUD rather than a right click.
Hold the Divination Sigil and run command “/wnn” (stand for Waila NBT Name). The identify name “AWWayofTime:divinationSigil” of it will be shown in chat window.
For Inventory Tweak user
After saving the config file. Run command “/wnr” (stand for Waila NBT Reload) to reload configuration.
Then hold the Divination Sigil and point at the Blood Altar.
It works!
Let’s try another. Daybloom.
Run command “/nbtedit” first.
ID is “botania:specialFlower”, and what useful data “mana” is under a NBTTagCompound named “subTileCmp”.
Save following content to “botania.json” in folder “config/WailaNBT”. (Where the default.json located.)
“.*” is an regular expression matches all string. Note it also matches hand without holding anything. Because holding nothing equals holding an item named “”(empty string).
And don’t forget run command “/wnr” to reload configuration.
Now point at Daybloom and it should work.
Part 2. Mobs(Entity)
Just write configs and change “Tile Entity ID” to “Entity ID”, which can be known by command “/wne”(stand for Waila NBT Entity).
And you can use “/nbtedit” to see NBT data structure of an entity too.
Following is the example config file for the picture of sheep above.
There are no method to look up the NBT data structure of an item, so a chest is needed. Put item in a chest and run command “/nbtedit”. The part surrounded with a blue border is the NBT structure of the item.
You need to change “Holding Item Name” to “tooltip” and change “Tile Entity ID” to “Item Name”, which cant be get by the command “/wnn”.
Following is the example config file for the picture of notch’s head above.
Don't forget to add the Holding Item and Tile Entity ID content. This part only focus on "Tag Name 1": "Display Name 1" content.
Printf style formatter
e.g. "Owner>>>Name":"This is %s's head!" will get the effect below.You may find "%.2f" useful. This will force it show 2 decimal places.
JavaScript
You may wanna do more than format a string, like divide ticks by 20 to show in seconds. JavaScript modifier is for you.Let's take furnace as an example.
To show the burn time in seconds, use this code below
"BurnTime": "function p(v){var r = (v/20);return 'Burn time left: '+r.toFixed(1)+' seconds'}"
Amazing!
"function p(v){}" is forced if you want to you JavaScript to modify the value. that's the basic function to run. "v" is the value read according to Tag Name and you can do anything you like in JavaScript with it. And don't forget to return what you want to display.
It's tricky sometime when you look up ID in an inventory. It's a number and hard to know what actually is. When encounter this problem, use a pre-defined object named "names".
You can use name['id'] to get the name of the numeric id. Note it can only handle limited localized name now.
e.g. If you want to display the first item name in a hopper. Write below in the config file:
"Items>>>0>>>id": "function p(v){r = 'first item is ' + names[v];return r}"
Waila will display:
Color and Font style
16 colors and bold/strike/underline/italic can be used to decorate displayed text. you can also use some text to make the text right/center aligned or use tab to make things neat.Unmodified text shows in grey.
To use colors and font style, please look it up in http://minecraft.gamepedia.com/Formatting_codes
To use align and tab:
"\u00A4\u00A4a" works as tab
"\u00A4\u00A4b" works as right-aligned
"\u00A4\u00A4c" works as center-aligned
The default style is "key tab+right-aligned+white value"
e.g."BrewTime": "Brew time left \u00A4\u00A4a\u00A4\u00A4b\u00A7f%.0f ticks" works as below.
Notice
Holding nothing equals holding an item named “”(empty string).
If display name is not provided (like “Amount”:””), the tag name(“Amount”) will be used.
If there are two config contains same “Tile Entity ID” and their “Holding Item Name” is same, one of “Tile Entity ID” will be ignored.
Folders in config/WailaNBT will be ignored.
Planning Feature
Allow hide type/part of info according to config, maybe keys
Better distribute and control pre-config files
Support download config from server side to make it not a cheat mod for SMP
More complex match method
Thanks
Pahimar for teaching me basic modding.
Davidee for bring us In-Game NBTEdit, and bjbinc for 1.7.10 port
ViKaleidoscope for Simplified Chinese localization and many config files.
Fixided for tutorial editing advice.
License
You can include it in modpacks and redistribute binary files. But a notice in this post and keeping a link to this post will be appreciated.
1.6.4 and 1.7.2 needed QWQ
Your instructions are crystal clear and easy to follow too
However, if you wouldn't mind, could you replace this....
...with mines instead?
This configuration means:
When player is holding an item named “Holding Item Name”,
and points the cursor at a Tile Entity with ID “Tile Entity ID 1″,
Waila HUD will display "Value of Tag Name 1, Display Name 1″.
-
Noob translation:
"Value of Tag Name 1" is What you want to be shown.
"Display Name 1" is the name that will represent "Value of Tag Name 1" in Waila's HUD.
“Tag Name 2>>>Tag Name 3″ means to display the value of “Tag Name 3″ in the NBT Tag Compound named “Tag Name 2″.
-
Noob translation:
~ A subfolder:
~ Use?: If a Tag Name is inside a Tag Name.
~ Basically: "Tag Name 3" is in "Tag Name 2"
“Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1″ support regular expression, but the regex must not contain “>>>”.
-
Noob translation:
~ “Holding Item Name”, “Tile Entity ID 1″ and “Tag Name 1" does not contain ">>>"
~ Only “Tag Name 2>>>Tag Name 3″ contains ">>>"
This is my edit to your current instructions.
I have no knowledge of coding,
so what I edited is what I understood from your current instructions.
So please fix any mistakes I made.
pretty cool!~\(≧▽≦)/~
Thanks! Just edited it.
I just had to come in and say that. Keep up the great work!
http://forum.feed-the-beast.com/threads/1-7-10-purgatory-mod-pack-v0-2-0-hqm-tech-quests-rf-beta-release-10-6.52413/
Something new. >w<
实际上我是Github的DoraJDJ啦:D
Now support Mobs(Entity) and Item(Tool tips)!
Changelog:
add /wne command to show entity id
support entity
more debug info in chat
Awesome work. I may start digging into this for addition into my modpack. I have been wanting something to view effective armor at a glance as many mods armor goes over what is displayed on the screen hud
http://forum.feed-the-beast.com/threads/1-7-10-purgatory-mod-pack-v0-2-0-hqm-tech-quests-rf-beta-release-10-6.52413/