mojira.dev
MC-93651

No placement sound when placing blocks on fence

Code analysis by @unknown can be found in this comment.

Related issues

MC-93753 fence sound MC-93769 Fences placed on other fences don't have a sound, or subtitle. MC-94140 placing blocks on fences MC-94276 Silent Fenceposts MC-94344 Problem whit fence's sound!! MC-94391 One sound not playing MC-94714 Blocks placed on fences produce no sound. MC-94976 Sound Missing with fence MC-95386 Fences don't make their usual placing sounds MC-95433 Torches doesn't make a sound when put on a fence MC-96288 no sound when place fence to another MC-96490 Placing fences next to other fences that have at least 1 block of air between the ground makes no sound. MC-96616 Put a block on a fence no play sounds MC-96628 Place a fence on a other fence don't give a place sound MC-96741 no sound when putting fences MC-96823 placing a fence on a fence don't give a place sound MC-97193 Putting blocks in top of fences doesn't make any sound. MC-97381 Placing a wooden fence in top of another wooden fence is missing a sound. MC-97486 sound bug MC-97561 No sound when placing Blocks on fences MC-97604 When placing blocks on fences, no sound is played. MC-97686 Putting fence on top of another fence doesn't play block sound MC-97729 Fences don't make placing noises when placed on each other MC-97731 Torches don't make placing noise when placed on a fence MC-97994 Fences sound bug MC-98026 No sound when placing a block on a fence MC-98065 Fences sound bug MC-98385 If I place a block attached to a fence, it isn't playing the place sound! MC-98492 No placing noise for anything on fence post MC-98773 When placing a block on a fence block the placement will make no sound. MC-98818 Missing fence Sounds MC-98904 Fence sound bug and bow bug MC-99026 Sound errors when placing blocks onto fences MC-99124 Minecart name screwed up? MC-99207 No sound plays when torch is placed on top of wooden fence MC-99381 No sound for torch MC-99437 If you place a block on a fence, it doesn't play a sound. MC-100299 Fences no sound! MC-100657 Placing blocks on fences MC-101564 Torches placed on wooden fences play no sound MC-101787 when placing fences in the ai it does not produce a sound MC-101848 Fences Sounds are bugged MC-101878 wrong sound of glass block and no sound of fence MC-102003 Fence Placing Sound Bug MC-102794 sound bug MC-102886 Stairs don't make a sound when placed on stairs MC-102919 Fence MC-103037 No block place sound when placing blocks on fences MC-103118 Placing a fence/wall on top of another fence/wall will not play the place sound. MC-103361 There are no sounds for placing any block on fence posts MC-103537 Sound bug with fences MC-104573 Sound missing when placing fence over fence. MC-104656 When placing Torch on a Fence there is no sound MC-105316 No Blockplacing sound played by blocks placed on, under or next to fences MC-105497 No sound for placing fence on fence MC-105547 Fence Sound Bug MC-105901 When you place a fence on top of another fence, the audio doesn't play. MC-105985 Placing Fence on a fence doesn't make a noise MC-106371 Placing blocks on top of fences have no noise MC-106480 dreagon head bugs MC-106608 Blocks on fences don't make sounds MC-106830 Block Placement sound does not work on fences unless crouching. MC-106838 No sound when a fence is placed on a fence MC-107351 Sound Not Working MC-108927 Blocks placed on fences do not make a sound MC-108947 No noise when you place a block on top of a fence post MC-108971 No sound while placing a block on a wooden fenced MC-109159 Noise of torch being placed on fence posts doesent play MC-109337 Fence makes no sound upon placement MC-109828 Armor Equipping Sound not played when looking at a fence MC-109830 Torches don't make placing sound on Fences, unless Shift is pressed MC-109930 No sound or subtitle made when placing blocks on fences

Attachments

Comments

migrated
[media]
[Mod]Les3awe

Can confirm.

[Mod]Les3awe

Confirmed for 15w50a

migrated

Still an issue in 15w51b

migrated

still seems to be an issue in 16w02a

wobst.michael

Issue confirmed for 16w02a.

wobst.michael

Issue in 16w03a

[Mod] Neko

Confirmed for 16w04a

[Mod] Neko

Confirmed for 16w05a

[Mod] Neko

Confirmed for 16w05b

migrated

Still an issue in 16w06a

[Mod] Neko

Confirmed for 16w07a

[Mod] Neko

Confirmed for 16w07b

migrated

Still an issue in 1.9-pre1

migrated

Still an issue in 1.9 Pre-Release 2

elrichmc

Pressing Shift you can hear the sound, without pressing it the issue stills there. Tested on 1.9 Pre-Release 1

migrated

Confirmed for Pre-Release 2

[Mod] Neko

Confirmed for 1.9 Pre-Release 3

migrated

Confirmed for 1.9 Pre3

migrated

please help Mojang out by not posting a comment that's the same a one before it, they're swamped enough as it is.

elrichmc

Confirmed for 1.9 Pre-Release 4

migrated

Confirmed for 1.9 ..

migrated

More detail in 1.9:

If you shift-click while placing a block on the fence, it makes the proper placement sound. This seems to be an interaction between the "attempting to 'use' item/tool on the fencepost" and "attempting to place a block on the fencepost" functions, as seen when you try to eat food while having the cursor over a fencepost.

[Mod] Neko

Confirmed for 1.9.1 Pre-Release 1

[Mod] Neko

Confirmed for 1.9.1 Pre-Release 2

[Mod] Neko

Confirmed for 1.9.1 Pre-Release 3

migrated

bug is still here - 1.9.2

marcono1234

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 because the method net.minecraft.block.BlockFence.onBlockActivated(World, BlockPos, IBlockState, EntityPlayer, EnumHand, ItemStack, EnumFacing, float, float, float) returns for the client always true, this means the client always acts as if it interacted with the fence.
In general the client places a block which creates the sound and sends a packet to the server. The server creates the sound then for all other players because it assumes the client placing the block acted the same way the server did and already played the sound.
The problem is that the client did not play the sound, but the server does not know that.

This could be solved by sending the server also what the client thought would happen. In this case interacting with the fence instead of placing a block. Then the server could send the sound to this client as well if the action differs from the one the server did.

Suggested fix

[Mod] Neko

Confirmed for 16w14a

[Mod] Neko

Confirmed for 16w15a

[Mod] Neko

Confirmed for 16w15b

[Mod] Neko

Confirmed for 1.9.3 Pre-Release 1

[Mod] Neko

Confirmed for 1.9.3 Pre-Release 2

[Mod] Neko

Confirmed for 1.9.3 Pre-Release 3

violine1101

Still in 1.9.4

[Mod] Neko

Confirmed for 16w20a

violine1101

Still in 16w21a and 16w21b

migrated

Still in 1.10 pre1

[Mod] Neko

Confirmed for 1.10-pre2

migrated

confirmed for 1.10

migrated

Confirmed for 1.10 : All Versions

Still broken since 1.9. Fix in plan?

It does play a sound when shift-right click.

[Mod] Neko

Confirmed for 1.10.2

pokechu22

Underlying cause is MC-21433 (which is WIA :/)

marcono1234

That is not quite the problem here as the block is placed. The problem is that the client always asumes that it interacted with the fence whereas the server does not behave like this and places the block.

pokechu22

Read the comments on that issue. They're the same effectively (it's just that the issue title is not as detailed). The full title I'd give to MC-21433 is "Fences are always interactive blocks clientside".

To put it another way, the fix you're suggesting (which I approve of) would also fix MC-21433.

marcono1234

Sorry, yes you are right. I thought they acted the same way iron doors or trapdoors act.

Mods please do not close this report as a duplicate because then we have an unnecessary discussion about whether or not it is WAI and like @unknown said it is definitely not.

I would suggest fixing it by having client and server call the method net.minecraft.item.ItemLead.attachToFence(EntityPlayer, World, BlockPos) but change this method to only create the LeashKnot and leash the entity server-side.

Note: The method net.minecraft.item.ItemLead.onItemUse(ItemStack, EntityPlayer, World, BlockPos, EnumHand, EnumFacing, float, float, float) contains kind of dead code because if the player successfully interacts with a block it will not use the item. If the player fails right clicking while holding a leash, this method will fail as well.

violine1101

Still in 16w38a.

migrated

Erik Broes

Confirmed

Minecraft 15w49a, Minecraft 15w49b, Minecraft 15w50a, Minecraft 15w51b, Minecraft 16w02a, ..., Minecraft 16w35a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b

Minecraft 16w39c

Retrieved