Skip to content

Commit

Permalink
add CompositeLootItemCondition to first level loot table condition de…
Browse files Browse the repository at this point in the history
…tection fpr hanging pale moss
  • Loading branch information
cech12 committed Feb 11, 2025
1 parent 83c257a commit 24b4104
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:any_of",
"terms": [
{
"ability": "shears_dig",
"condition": "neoforge:can_item_perform_ability"
},
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
]
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:pale_hanging_moss"
}
],
"rolls": 1.0
}
],
"random_sequence": "minecraft:blocks/pale_hanging_moss"
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ private boolean findAndReplaceInLootPool(LootPool lootPool, LootTable.Builder ne
} else {
found |= replaceCondition(invLootCondition, consumer);
}
} else if (lootCondition instanceof CompositeLootItemCondition composite) {
found |= findAndReplaceInComposite(composite, poolBuilder::when);
} else {
found |= replaceCondition(lootCondition, poolBuilder::when);
}
Expand Down

0 comments on commit 24b4104

Please sign in to comment.