The bug
There is a 'shield blocking' sound when you right click to block with your shield. However if player A blocks with their shield, they cannot hear the sound; only player B standing nearby can hear it. (The sound apparently does not play in single-player.)
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
relates to 3
testing discovered 1
Comments 15
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is very likely because the net.minecraft.entity.player.EntityPlayer.playSound(SoundEvent, float, float)
method is called by the net.minecraft.entity.EntityLivingBase.func_184606_a_(ItemStack)
method to play the sound. This method is for reasons I do not know at the moment only called server-side. This method calls other methods calling the method net.minecraft.server.management.PlayerList.sendToAllNearExcept(EntityPlayer, double, double, double, double, int, Packet<?>)
with the current player as argument for the EntityPlayer
parameter. This method, as its name already suggests, sends a packet to all near players except the specified one.
Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.
This is an automated comment on any open or reopened issue with out-of-date affected versions.
There are some circumstances where the sound plays only for the person blocking with the shield, and not anybody else. Very strange. Confirmed for 20w20b
This is not that duplicate. This has nothing to do with damage, this is just standing in a peaceful field and right clicking your shield to move it in front of your body.