adibarra / enchant-tweaker

Tweak many enchantment related mechanics while keeping the vanilla minecraft feel.
https://modrinth.com/mod/enchant-tweaker
MIT License
4 stars 0 forks source link

bug: setting enchantments to `0` in config causes issues #7

Closed Surpos0 closed 1 year ago

Surpos0 commented 1 year ago

What happened?

I set on of the enchantments to have max lvl zero so it no longer appear in game, and when i started looking at resoults in creative tabs i spoted that enchantments that were supposed to not be optainable, are but with weird lvl description. And even when it says in this buged descripition that it is on lvl 0 i can put it on sword and it still provides 1 bonus dmg (cuz i wanted to delete sharpens from the game).

What should have happened?

the enchantments that have max lvl on zero should not appear

How to reproduce?

set one of the enchantments max lvl to 0 in config

What is the jar file name?

enchanttweaker-1.4.3+mc1.20-1.20.1.jar

Any relevant logs?

No response

Anything else?

No response

Before submitting...

adibarra commented 1 year ago

As far as I can tell, there seem to be a few distinct bugs you are reporting:

  1. The creative menu has enchanted books when the config is set to level 0 (for that enchantment).
  2. Level 0 enchanted books appear in the creative menu.
  3. Weird item descriptions for level 0 enchanted books.
  4. Items with level 0 enchantments still have effects.

For #1: Are you playing in singleplayer or multiplayer? This should always work properly in singleplayer. However, multiplayer requires that you manually sync you config with the server's config as written in the mod description. (Doing it automatically is a feature on the to do list.)

For #2: I tried to replicate this but wasn't able to. Could you be more clear in exactly what steps you took?

For #3: Dependent on replicating #2.

For #4: This is vanilla minecraft behavior.

Answer the above questions when you get a chance, thanks!

Surpos0 commented 1 year ago

(singleplayer) video of repport: https://youtu.be/Cn2a7GzB7kQ

adibarra commented 1 year ago

Ok, I was able to replicate #1 and #2 this time. Turns out level 0 books only appear in the 'Ingredients' tab of the creative menu but not in the search tab.

Additionally, I was now able to test #3 and I can confirm that it is vanilla behavior. However, I'll add some more custom level names so that it doesn't say 'enchantment.level.0' anymore.

adibarra commented 1 year ago

Alright, after some poking around, the only way to fix the level 0 books appearing in the creative menu is pretty non-trivial. It would probably require building some new systems to modify it on-the-fly. However, that is pretty out of scope for the mod, and seeing as this is a pretty low-impact bug that only occurs in creative mode, I don't think it's worth the effort to fix it.

That said, #3 is fairly unrelated and is something that I can quickly fix, so I'll make a new issue for it (#8) and patch it in the next update.