I'm trying to add a new drop, 'Dark Quartz', as a rare drop for the nether quartz ore, using a datapack. I want to replace the old loot table and add a new one, so I've copied the vanilla one out of the vanilla datapack and put it in the minecraft namespace in my datapack:
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "minecraft:nether_quartz_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minecraft:quartz"
}
]
}
]
}
]
}
As you can see, there is one entry of the type minecraft:alternatives
. This will select one entry from a list of "children":
sub-entries. There are two sub-entries: one for if the player uses a silk touch pick, and one for if they use a pickaxe with fortune (including Fortune 0). I want to make the second entry, with the Fortune, have a 1/20 chance of additionally dropping a Dark Quartz item.
I know that to do this I can't add a third entry, because it would drop the Dark Quartz instead of the normal quartz, so therefore I need to nest two sub-sub-entries in the second sub-entry, and have the normal quartz sub-sub-entry get picked always and the other sub-sub-entry get picked 1/20 times.
This is where I'm stuck, because I don't know if nesting in this way is possible, or how to make one entry always be selected and the other be selected a certain portion of the time. Additionally, I would ideally have it where if there was no fortune on the pick, the only drop would be either quartz (19/20) or dark quartz (1/20). If there was a fortune great enough to have multiple drops, only one of the normal quartzes would have a 1/20 percent chance of being a Dark Quartz, while the rest would stay the same. However, I would be content with just getting the dark quartz to additionally be selected 5% of the time, as I originally detailed. If you need it for reference, the entry for my Dark Quartz should look something like this:
{
"type": "minecraft:item",
"functions": [
{
"function": "set_name",
"name": {"text":"Dark Quartz","color":"dark_gray","italic":"false"}
},
{
"function": "set_nbt",
"tag": "{DarkQuartz:1b,CustomModelData:1}"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minecraft:quartz"
}
Any help is appreciated.
quartz OR (quartz AND dark_quartz)
You would need to either specify the regular quartz twice or include a sub-loot-table./schedule
) is involved. Finally, I think if anyone has a question about CustomModelData it should have minecraft-resourcepack and minecraft-datapack."sequence"
type of entry, which is basically AND. Just gotta get the probability to work and I'll post the solution as an answer.