When giving yourself a tool with enchantments above 255 (for example, 1000) using the command block (which worked on previous versions), a tool with an enchantment level of 255 is issued.
Related issues
Attachments
Comments

Thank you for your report!
We're tracking this issue as MC-10755, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as Won't Fix, which means this is considered a bug but won't be fixed. The description of that ticket or the comments might explain the rationale. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki

Hello Greymagic27,
I have just found out about this bug in my Minecraft server, and have tried to report it, but finding this post first. I do not think this post is a duplicate of MC-10755, as that bug was 7 years ago, and in ** Minecraft Snapshot 13w09c. Also, it was about effects, and about the limit of mining fatigue being 4 before you cannot break anything. If this was an intentional feature, or a feature Mojang does not want to fix you should flag it as that. But this is a legitimate post, and if your post was not created by a bot, maybe you should check the issue first.
Best Regards,
MeerPup1Β
This works as intended. In fact, it's not even a new change. Nearly all enchantments have been effectively limited to 255 since at least 1.13

Hello tryashtar,
I disagree with you. For example, I (and, I think, all players) had special sword in saved hotbars with enchantment "sharpness 100000" for killing any mob if I want, but after 1.17.1 I have only "sharpness 255" and I can't kill some mobs for first strike (ender dragon, wither and some other).Β I attach a screenshot with a comparison. The first part was made on version 1.17 (everything is similar on version 1.16.5 and previous versions). The second part of the screenshot was made on version 1.17.1. The screenshot clearly shows the change. Most enchantments worked similarly, for example, looting.Β Also, this bug broke some maps for passing and I think that it should be fixed
Β
[media]
The reason you were able to have unsupported things like Sharpness 10000 in versions before 1.17.1 was due to a bug which got fixed in 1.17.1 Pre-release 1. See MC-131290.

Hello Michael Wobst,
I am have checked the changelog of Minecraft version 1.17.1, and indeed, they have fixed that bug. One thing I have noted, it that they have changed the enchantment data from an signed short to an unsigned char to fix the integer overflow. This does seem a viable fix, but I really enjoyed having overpowered enchants to mess with my friends. I do have another idea of a fix for any Mojang employees out there. I would suggest considering changing the enchant value to an unsigned short. I am not sure if this will be a viable fix, as I am not very familiar with Java programming. This would increase the enchantment limit from 255 to 65535. I know for sure this would make me and most likely many other Minecraft players more satisfied than having an enchant limit of 255.
Best Regards,
MeerPup1
Sharpness was indeed one of the four enchantments that previously were not limited, however you can just use attribute modifiers to buff your damage arbitrarily high

Hello tryashtar,
After doing some testing with entities with high absorption heart numbers, the damage appears to cap at 2048 using attribute modifiers (regardless if you put a million or a 32-bit integer in it), whereas with enchantments this number was generously limited at billions. This breaks a lot of things made with high enchantment levels prior to 1.17.1. For example, if a player had a map where there was an entity with 10 million (absorption) health and had sharpness 100000 sword, it would take reasonable amount of time to beat it, in current situation this map is broken because the entity is practically unbeatable. A valid counter-argument to this is to use smaller numbers, but what if the map is designed to have a progression of items with increasingly higher damage? Not that i am developing such map or anything but with a vast playerbase like this, it should be considered. I personally think this change (bugfix) did more harm than good and should be reverted, as a person which plays creative with friends it makes us be stuck to use 1.17 indefinitely.
That's a good point

I am a little sad they fixed this cause back when you could have sharpness 10000 swords it was really fun