-
Bug
-
Resolution: Fixed
-
Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2
-
Confirmed
-
Survival
The bug
When renaming an item in an anvil, you can type 31 characters (and it'll display the new name in the output slot). However, if the item is grabbed from the output slot (or forcibly updated by adding and removing an item into the second input slot), then only the first 30 characters of the name will be used.
Reproduction
A more common scenario:
- Open an anvil UI.
- Put an item into the first slot
- Type _ into the name field until it won't let you type it anymore.
- Press backspace once
- Type ! into the name field, so that the name ends with a single !.
- Grab the item out of the output slot (or insert and remove an incompatible item in the second input slot)
- Observe that the new item name no longer has the ! at the end!
A less common scenario:
- Open an anvil UI
- Put an item into the first slot
- Select the entire name with Ctrl+A
- Paste the following text over the name (paste must be used, as the entire text must be set at once): 0123456789012345678901234567890
- Attempt to take the item out of the output slot. The game will reject it completely, as the item did not actually get renamed.
Cause
For some reason, the text field max length was increased to 31 characters in 16w50a. However, the corresponding handler for the MC|ItemName plugin channel did not have its max length adjusted, rejecting it if it is over 30 characters long. Since MC|ItemName is continuously sent when renaming the item, the last valid name (usually the 30-character version) is used instead of the 31 character version (if there is no last valid name, then the game will think the name did not change). This could be fixed either by increasing the maximum length for MC|ItemName or unincreasing the max length in the anvil UI.