Steps to Reproduce
Start a Vanilla Minecraft Java Edition server (version 1.21.11 confirmed).
Join the server with operator (OP) permissions.
Ensure your character's armor slots are empty. You can verify the baseline armor value by executing:
/attribute @s minecraft:generic.armor get(It should return approximately0.0E-7).Execute the command to force a non-armor item into the helmet slot:
/item replace entity @s armor.head with minecraft:glassImmediately query the armor attribute again:
/attribute @s minecraft:armor getManually remove the glass from the helmet slot via the inventory.
Query the armor attribute a third time:
/attribute @s minecraft:armor get
What I expected to happen :
The
glassitem, not being armor, should not be equippable in the armor slot or should contribute zero armor points.After removing the glass, the player's
armorattribute should return exactly to its correct baseline (0).
What happened instead:
After step 4 and step 5: The
armorattribute value becomes11.0(which equals 11 armor points, visually increasing the armor bar). This is an incorrect, massively inflated value.After step 6 and step 7: The attribute value does not reset to zero. It persists at an incorrect residual value (e.g.,
2.0E). This proves a state corruption.
Additional Information :
Severity : This bug allows players with command access to grant permanent, unfair armor bonuses, breaking survival mode balance.
Environment: Reproduced on an Aternos-hosted Vanilla server, confirming it is a bug in the official Mojang server software.
Suggested Fix : The
/item replacecommand (or the underlying game logic) should validate that an item belongs to the armor category before allowing it to be placed in an armor slot and before calculating its attribute contributions.
Environment
Server Environment :
Software: Official Minecraft Java Edition Vanilla server JAR.
Version: 1.21.11 (Confirmed via /version command output: "This server is running Vanilla Minecraft version 1.21.11").
Hosting: Aternos (providing an unmodified Vanilla server environment).
Key Configuration: The server was running with online-mode=false and the user had operator (OP) permissions, which were necessary to execute the /item replace command for testing.
Client Environment :
Software Standard Minecraft Java Edition client.
Modifications: No mods, data packs, resource packs, or plugins were installed on either the client or the server. This was a pure Vanilla setup.
Attachments
Comments 4
Me neither. Can you upload a video recording showcasing the bug, with the debug overlay (F3) enabled and showing the game version for at least part of the recording?
You can record your screen using:
On Windows, the built-in Snipping Tool app (shift+win+S)
On macOS, the the built-in Screenshot app (shift+cmd+5)
Third-party software such as OBS
It is recommended that you trim, convert and/or reduce the quality of your recording so that it is under 10MB, as this will make the upload much quicker.