JerryLu086 / Netherite-Horse-Armor

1 stars 0 forks source link

[Bug] Loot Table Doesn't Work Properly #4

Closed Fyoncle closed 1 month ago

Fyoncle commented 2 months ago

Does it really work? or not. i wasn't able to find any

Fyoncle commented 2 months ago

I checked inside the mod a bit and theres no file for loot tables in 1.20.1 fabric...?

Fyoncle commented 2 months ago

Even tho i set the weight to 1000000000 i only got 3 netherite horse armors spawned in the treasure room chest, that is so strange. Why is it that rare?

JerryLu086 commented 1 month ago

First, yes, the mod itself (either on Forge or Fabric) does not modify the vanilla loot table in the usual way as you might do with data packs. Instead, for the sake of compatibility, it injects an entry into the first pool of the existing bastion loot table, as overwriting it entirely would likely break other mods that do the same thing.

Second, that's not how the weight of a loot entry works. Take the bastion_treasure loot table for example, it has 4 pools, and the first pool has 3 rolls, meaning that the first pool will choose 3 entries to put into the loot chest. Let's say we've set the weight of horse armor to 1,000,000,000 like you did, and there are other 4 entries with the weight of 10 each, the chance of getting 1 horse armor in a roll is: 10^9 / (10^9 + 10 * 4), which is almost a 100%. But that said, you can only get 3 of them at most, as the weight only affect the first pool, which can only decide 3 entries to add.

I guess it's quite difficult to understand how it works with my words above, I recommend checking the wiki if you're interested.