Set Bonus

Set Bonus

10M Downloads

[Help] Cant get NBT data from array

CmdrJane opened this issue ยท 3 comments

commented

I'am using Set Bonus mod with Silent Gear and i want to add set effect based of material that armor is maked of, but i can get nbt tag from array.
Full NBT https://pastebin.com/kWMPfEbL
I need to get data from "Key" Tag, which is inside array

[{Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:planks", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_wood"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:cobblestone", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_stone"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:planks", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_wood"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:flint", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_flint"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:flint", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_flint"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:planks", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_wood"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:cobblestone", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_stone"}, {Item: {ForgeCaps: {"customnpcs:itemscripteddata": {}}, id: "minecraft:planks", Count: 1 as byte, Damage: 0 as short}, Key: "silentgear:main_wood"}]}

However, can't get further this line:

<silentgear:chestplate>.withTag({ToolCore_Data: {Construction: {Parts:

I'am already tried every form of synthax but can't get it to work. This is how my equip line looks like:
S:"1. Equipment" <
SlArmorWood, silentgear:chestplate > ToolCore_Data:Construction:Parts
>
And at this point it works. But i cant get any further. Am i doing something wrong or this is possibly bug?

Full CFG: https://pastebin.com/Z2sg8A9a

commented

I was wondering if/when something like this would come up...

The NBT filter for Set Bonus doesn't currently support array tags, so this is not a mistake on your part. This might not be too much trouble to add, so I'll take a look at it this weekend and see. If it's going to take too much time though, it might have to wait

commented

I take it back; apparently I did add support for arrays, and forgot about it.

Here is an example config file you can base yours off of:
https://pastebin.com/Y4Sukyai

Edit:
Array support is limited. You cannot, for example, specify that the same array entry contain multiple things. If you give it multiple things to look for in an array, it will check each array element for each thing, not each element for all things.

Also, I'm not 100% sure if the specific part of the data I used is the best part to use or not (Key = "main_wood"). You'll have to decide whether to use that, or to use the more specific component bit

As a final side note, if you want a better way of looking at / editing raw NBT, go check out my "NBT Manipulator" mod.

commented

thx for help buddy