The Bug
The "/item replace" command is the successor of "/replaceitem" in 1.17. However, unlike its predecessor, this new command causes the replacement of armor to cause the sound effect of when one is equipping armor.
The sound effects do not play to the player the "/item replace" command is affecting - the sound is only played to other players near them.
Steps to replication:
At least two players are required. One for the "/item replace" to affect, and the other(s) as the bystander(s).
Place and activate a Repeating Command Block with the command "/item replace entity @p armor.chest with minecraft:diamond_chestplate".
The affected player will have a diamond chestplate constantly replaced in their chest armor slot - the bystander(s) will constantly hear the sound of the former equipping a diamond chestplate.
This occurs with all armor types, armor parts, and Elytras. This does not occur with items/slots within the inventory or hotbar. Please disable the sound for other players in future developments.
Observed Behavior:
The minecraft:item.armor.equip_TYPE sound can only be heard by other players when using the "/item replace" command.
Expected Behavior:
The minecraft:item.armor.equip_TYPE sound would be able to be heard by all players when using the "/item replace" command.
Attachments
Comments 9
Can confirm this behavior in 21w39a. Here are some extra details regarding this issue. I've also attached some videos and screenshots that demonstrate what different players hear in this scenario.
[media][media][media][media]The Bug:
The minecraft:item.armor.equip_TYPE sound can only be heard by other players when using the "/item replace" command.
Steps to Reproduce:
Get two players and label them "Player A" and "Player B".
Get both players to stand next to one another.
Get "Player A" to use the "/item replace" command to equip an iron chestplate and ensure that both players listen closely.
/item replace entity @s armor.chest with minecraft:iron_chestplate
Compare what "Player A" heard to what "Player B" heard.
Observed Behavior:
The minecraft:item.armor.equip_TYPE sound can only be heard by other players when using the "/item replace" command.
Expected Behavior:
The minecraft:item.armor.equip_TYPE sound would be able to be heard by all players when using the "/item replace" command.
This issue was present in 22w19a, but no longer occurs in versions above or equal to 1.19 Pre-release 1. With that being said, this issue has been fixed in 1.19 Pre-release 1. This sound is now broadcasted to all players and not just the client and this behavior is expected since the given armor is being equipped, therefore a sound should be produced.
The report is still not fixed, Avoma, as the report stated that the fact a sound was made was different from /replaceitem. It's now consistent for all players, yes, but the report's concern is not addressed.
Yes, my bad, you are indeed correct; thanks for letting me know. I've edited my above comment. Apologies!
I can no longer reproduce this issue in 1.21 Pre-Release 3. When using /item replace to equip armor, the sound is played regardless of who uses the command, and who the command targets:
[media]
Replacing the armor with the same type of armor also now plays no sound at all for both players.
Can confirm