-
Notifications
You must be signed in to change notification settings - Fork 12
NBT Tools | NBTQuery
The NBTQuery makes it possible to fetch specific data from NBT.
The way it works is that the NBTQuery constructs a NBTComound, of the values it was specified to fetch, and then returns it. That compound can be then used for anything, like merging it with other items NBT Tags (See CustomCraftings' NBTMergeAdapter).
The query is written in JSON and provides options to filter elements by value, index in lists, and child NBT nodes. To build the query and describe the desired output, you can use the following settings.
Can be used for all types of NBT Tags (including primitive, compound, lists, etc.)
By using a boolean value, you can either not include a Tag in a result (false default), or include it (true).
When used for Compounds, it includes the whole Compound with all child tags!
For List Tags, it includes the whole list.
Example:
"<tag_key>": trueIncludes the tag if it matches the specified value.
"<tag_key>": "<value>""<tag_key>": "<value>b",
// or
"<tag_key>": "<value>B""<tag_key>": "<value>s",
// or
"<tag_key>": "<value>S""<tag_key>": "<value>i",
// or
"<tag_key>": "<value>I",
// or
"<tag_key>": <value>"<tag_key>": "<value>l",
// or
"<tag_key>": "<value>L""<tag_key>": "<value>d",
// or
"<tag_key>": "<value>D",
// or
"<tag_key>": <value>"<tag_key>": "<value>f",
// or
"<tag_key>": "<value>F"type:
compound
Includes the Compound Tag with all the children that match the inclusion settings.
-
preservePath(Default:true): Keeps the path of the parent and child tags. -
includeAll(Default:false): Determines the default value of eachincludeschild. -
includes(Default:{}): Specifies the includes values of the children. Each child set totruewill be included. -
children(Default:{}): Proceeds to child tags. In caseincludesis not empty, then it only proceeds to included child tags!
"<tag_key>": {
"type": "compound",
"preservePath": true, // Optional: keeps the path of the parent and child tags.
"includesAll": false, // Optional: determines the default value for each `includes` child.
// Optional: Only includes and computes the specified children.
"includes": {
"<child_key>": true, // true or false
// If a key is not specified it will use the value from `includesAll`
},
// Proceed to child tags. If `includes` is used, then it just proceeds to the included child tags!
"children": {
"<child_key>": /*<child_settings>*/
},
//Optional, child keys may be directly written into the root of the compound settings.
"<child_key>": /*<child_settings>*/
}type:
list/<string|byte|short|long|int|double|float>
Includes the NBT List Tag with the specified values.
-
elements(Default:[]): List of settings for tags to be included.- List entry:
-
index(Optional): Returns the value at the specified index, if it matches the setting. -
value(Optional, Default:true): The value settings (primitive, compound, etc. depending on list type)
-
- List entry:
"<tag_key>": {
"type": "list/<string|byte|short|long|int|double|float|compound>",
"elements": [
{
"index": 0, //Optional: Returns the value at the specified index, if it matches the setting.
"value": /*value settings*/ //Optional: The value settings (primitive, compound, etc. depending on list type)
},
//...
]
}| Home
| Registry
-
Introduction
- Structure
- InventoryAPI
- Register GuiCluster
- CustomCache
- GuiClusters
- GuiWindow
-
Buttons
- Dummy
- Action
- Toggle
- ChatInput
- MultipleChoice
-
ButtonStates
- ButtonFunctions
- ButtonAction
- ButtonPostAction
- ButtonPreRender
- ButtonRender
- ButtonFunctions