Epoxide-Software / Enchanting-Plus

The official repository for the Enchanting Plus mod.
36 stars 26 forks source link

Infinite XP exploit with Enchanting Plus Books #175

Open xJon opened 4 years ago

xJon commented 4 years ago

As reported to my modpack over https://github.com/xJon/The-1.12.2-Pack/issues/479, this mod can be exploited in order to get any enchantment you want, simply by placing enough Enchanting Plus Books next to an Advanced Enchanting Table (17 to be exact).

The reporter included a series of screenshots to further illustrate the exploit:

https://imgur.com/a/hzWiM6H

Would love to get this fixed in a future update. Thank you.

fucnknown commented 4 years ago

Hey, I did some research trying to replicate this issue. This problem happens because of the level you have configured costFactor plus because of how Eplus gets the enchanting level (EnchantmentUtils.getEnchantPower) which uses as a discount percentage in the cost;
You can have up to 32 objects sorrounding a table, if they are simple libraries or the decorating books with default configuration, they reduce the cost by 32%.-
Botania pillars are capable of a multiplied value too.

So, when the guy reporting the issue sets 17 books, with the multiplier, it goes way over 100% discount.
Causing negative values

As a patch you could reduce the value to 3, so that 32 books would give a 96% discount or something less.

The solution should be to block the maximum to 100%