Server does not send repair cost to client on some versions
How do I remove the inscription "Enchantment cost"? Is it even possible. If so, how?
I assume you might be using a Minecraft version between 1.7 and 1.10?
From a quick look at the code, it seems like the enchantment cost is not properly sent from the server to the client on Minecraft versions between 1.7 and 1.10, so on those versions, the client will set the enchantment cost according to vanilla mechanics. However, on Minecraft versions 1.11 and above, you should see that the enchantment cost gets sent (AnvilGUI always sets a cost of 0, so basically the cost should not be shown in the client).
Side note: Even on 1.11+, you can sometimes see a "flicker" of an enchantment cost for a split second when typing in the text box. This is because the client always sets a repair cost first, even if the server sends a repair cost of 0 as an override. This is, as far as I can tell, an unavoidable limitation of the game, it's impossible to always send the 0 repair cost from the server fast enough so that the client value never gets shown. But again, at least it only shows for a split second. It's just a limitation we'll have to live with, I think.
I can fix the AnvilGUI code for 1.7 - 1.10 so that it properly sends the repair cost to the client though. But it'll have to wait a few days, I'm pretty busy right now.
I am using version 1.16.5. This can be fixed if you put the item in the right slot, but this is not an option and errors occur. I wish there was no inscription with an empty slot. I have attached my photo
I just checked on 1.20.2 and everything works fine there, sometimes it flickers. And at 1.16.5 the inscription does not even disappear
You're right, it also doesn't send the repair cost to the client on 1.16.5. I had another look at the code, and it turns out that it was messier than I initially thought:
- 1.7-1.10: Repair cost is not sent properly
- 1.11: Repair cost is sent properly
- 1.12-1.13: Repair cost is not sent properly on Spigot, but Paper has a patch for it, so it works correctly on Paper servers
- 1.14-1.16: Repair cost is not sent properly
- 1.17-1.21: Repair cost is sent properly
Anyways, I'm pretty confident that this can be fixed by AnvilGUI, will have a look at it in a few days.
Update: Those few days turned into weeks, but I've made some progress and will hopefully push a PR in a few days.
Thanks!
Hello, I tested on 1.21.4 and the Enchantment Cost message is still shown
Hello, I tested on 1.21.4 and the Enchantment Cost message is still shown
1.21.4 client version 1.21.1 server version
@Askarionn You are right, the bug is not fixed yet (which is why this issue is still open). I am about 90% done but life got in the way of things and I had to deprioritize work on this issue. But the good news is that I think I will have some time in a few days, so hopefully we can get this bug fixed "soon".
Thank you @0dinD!
Hmm, upon further inspection it seems like this is a lot more work than I have time for right now. Not impossible, but a lot of work, due to the way AnvilGUI works. Unfortunately I don't have that much time to spend right now, so this will have to wait a bit longer.