Origins (Fabric)

Origins (Fabric)

15M Downloads

Possible Bug: Water Protection Books Overweighted?

BlizzardofDreams opened this issue ยท 2 comments

commented

I've been playing on a casual server with some buddies (one of whom set up the server), and we've all noticed that Water Protection enchantments seem to be disproportionately likely as enchantments found on books in treasure hauls (i.e. dungeon chests, shipwreck chests, etc.). I suspect this may be a sign that the weight given to the probability of Water Protection enchantments spawning as loot may be too high (since presumably, we want enchantments other than Water Prot to drop).

Is this a known bug (or intended feature)? I looked through the relevant source (src/main/java/io/github/apace100/origins/enchantment/WaterProtectionEnchantment.java) and couldn't spot anything that might be causing this, but also I only have experience with R, and am only a beginner at that.

commented

The WaterProtectionEnchantment is instantiated here:

 public static final Enchantment WATER_PROTECTION = new WaterProtectionEnchantment(Enchantment.Rarity.RARE, EnchantmentTarget.ARMOR, new EquipmentSlot[]{EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET});

Note the Enchantment.Rarity.RARE as the choice for enchantment rarity. From what I can see, the only rarer option is Enchantment.Rarity.VERY_RARE.

Note that dungeon chests (and indeed any chests) have an equal opportunity to generate any enchantment on a book (according to the Minecraft Wiki), meaning that enchantment rarity doesn't appear to affect loot generation. Maybe you and your friends have just been having exceptional luck getting Water Protection books and loot?

commented

In addition to what MineRobber9000 said, water protection books are added as an additional roll to the loot tables of those chests. Which means they do not affect the other loot that was generated. Without the mod installed, you would see the same chest content but without an enchanted book, if you were using the same seed, not the same chest content with an enchanted book which has a different enchantment.
Therefore, they might be "overweighted" in the sense that it's not too difficult to get them, however this does not (majorly) affect other enchanted books you would be getting.