[Feature Suggestion] Add way for the mod to detect custom nbt data in items
elhertz opened this issue ยท 7 comments
I don't know how to explain this very well but I'd like to make something like a ring with custom name, lore, etc. using Nbt Crafting and use that item to enable flying. That way I can make a recipe with hard-to-get items to make a custom item that grants flight. Is this possible?
i haven't tried nbt crafting but if i understand it correctly you should now be able to
"result": {
"item": "minecraft:diamond_axe",
"data": {
"someCustomNBTValueMagic": 1
}
}
and then in fscript something like
~hand:[
~nbt~someCustomNBTValueMagic:int:1
]
(after updating fscript to 3.1.4)
Thanks!
I'm using this in "creative_flight.script"
~hand:[
~nbt~flightNBT:int:1
]
but console is throwing this error:
[20:33:22] [main/INFO]: tf.ssf.sfort.survivalflight successfully loaded config file
[20:33:22] [main/ERROR]: tf.ssf.sfort.survivalflight failed to load flight script file
java.util.NoSuchElementException
[20:33:22] [main/INFO]: tf.ssf.sfort.survivalflight successfully loaded elytra script file
[20:33:22] [main/INFO]: tf.ssf.sfort.survivalflight successfully loaded elytra boost script file
I can fly without the item. Am I doing something wrong? I didn't touch the settings
edit:
i'm also getting these errors after a second restart (i didn't touch the settings and i can recreate it by deleting the config and restarting the server two times, after the second restart it will throw the following errors)
[20:46:29] [main/WARN]: tf.ssf.sfort.survivalflight #6
java.lang.NumberFormatException: For input string: "null"
[20:46:29] [main/WARN]: tf.ssf.sfort.survivalflight #16
java.lang.NumberFormatException: For input string: "null"
[20:46:29] [main/INFO]: tf.ssf.sfort.survivalflight successfully loaded config file
[20:46:29] [main/ERROR]: tf.ssf.sfort.survivalflight failed to load flight script file
java.util.NoSuchElementException
[20:46:29] [main/ERROR]: tf.ssf.sfort.survivalflight failed to load elytra script file
java.util.NoSuchElementException
[20:46:29] [main/INFO]: tf.ssf.sfort.survivalflight successfully loaded elytra boost script file
I managed to get it working. NbtCrafting was converting the tag into a "byte" value so I changed the script and it works
~hand:[
~nbt~flightNBT:byte:1;
]
I can also change the datatype with NbtCrafting so it detects the "integer" but it doesn't really matter.
Thanks!
Question: How do I make it work either on hand or off hand? I've been trying to make it work but I don't understand how to put multiple embed without the console throwing an error.