mojira.dev
MC-98271

The sound of blocking with a shield is only hearable by other players (not the person blocking)

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

Comments 15

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.

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.

Still an issue in 1.14, I'm also requesting to be the reporter since the current one is inactive.

5 more comments

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

Can confirm in 1.16.4

Blocking with a shield no longer makes a sound for anyone. Should this be reported as a bug?

Brian McNamara

(Unassigned)

Confirmed

Platform

Normal

Networking, Sound

Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.11.2, 1.14.4, 1.15.2, ..., 20w17a, 20w19a, 20w20b, 1.16.1, 1.16.4

25w04a

Retrieved