-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom NBT data for loot #351
Comments
I just realized that loot is defined as JSON, not YAML. I will correct the issue text ASAP. |
It would be nice to be able to import mmoitems defined in the same format as usual in the plugin type.name - so for eg. MATERIAL.silver-ingot It would pull the nbt from MMOItems and generate it |
@StrangeOne101 Has this already been implemented with your changes? |
@CocoTheOwner Custom NBT is not yet supported. It is probably something we will support when we do loot v3 |
@StrangeOne101 is #46 a duplicate of this or are they clearly separate? if (dupe) close a or close b |
They are not duplicates, no. One is for NBT support for objects/blocks and one is for supporting NBT in loot tables |
This wouldnt be custom support for loot talbles, it's support for custom NBT in items. A loot table is really just a list of Items (in iris). But yes, we should add this. |
Added in latest, done like this.
|
Is your feature request related to a problem? Please describe.
It is currently not possible to describe loot which has custom NBT data attached to it.
NBT is die primary way for other plugins to define a custom item (AdvancedEnchantments, Items Adder, MMOItems, etc.)
Those plugins come with their own ways to define loottables, but i think they don't work with Iris, because it sets it's own loot tables, right?
Describe the solution you'd like
A normal definiton for loot in a
loot.json
file is as follows:It would be perfect, if we could have an extra field called
customNbt
which accepts an escaped string of raw NBT data.Using the command
/data get entity @p SelectedItem
i can print out the NBT data of a hold item. It returns something like this:but we only really need whats coming after
tag
and before, Count: 1b}
at the end:This is the NBT data you'd need to pass to the
give
command to spawn a holy white scroll from AdvancedEnchantments when you give yourself an item. In my case the base item was an ink sack, but thats not important.The only problem here is that minecraft tends to mix " and ' and does not return valid JSON. One possible way would be to simply
escape all instances of " inside the NBT string. Following my idea the above loot definition could look like this:
Describe alternatives you've considered
An alternative would be to include an
customNbt
field where you can set custom NBT data in a more JSON friendly fashion. This would have the merit of being way easier to read, but you could not just copy and paste NBT data. Coming from the example above it would look something like this (without the text formatting for the name and lore):The text was updated successfully, but these errors were encountered: