Fix #718 incomplete table_bonus condition

This commit is contained in:
Misode
2025-04-12 16:52:52 +02:00
parent 844cc44ac7
commit 474b2dfe52
4 changed files with 8 additions and 2 deletions

View File

@@ -476,6 +476,9 @@ const LootConditions: Record<string, (params: any) => LootCondition> = {
},
survives_explosion: () => () => true,
table_bonus: ({ chances }) => (ctx) => {
if (!chances) {
return false
}
const level = 0 // TODO: get enchantment level from tool
const chance = chances[clamp(level, 0, chances.length - 1)]
return ctx.random.nextFloat() < chance