mojira.dev
MC-163921

Placing a block while looking at redstone ore plays no sound

The bug

When a block is placed by using the item on one of the faces of a redstone ore block, the block placement sound is not played. Things like item frames play the sound as expected.

How to reproduce

Simply place some redstone ore and then click on it to place another one. The first ore will light up and the block will be placed, but no block sound is played.

Linked issues

MC-164925 Redstone Ore sound bug Resolved MC-165867 placing sound is mute while placing a block on redstone ore Resolved MC-167378 Placing blocks on redstone ores will place the block then emit particles Resolved MC-167491 Lantern placement sound dosent happen when placed on top or hanging under redstone ore Resolved MC-167792 Blocks placed on redstone ore do not make a sound when placed. Resolved

Attachments

Comments 17

Theresa Campbell

Can confirm and added short video example. It seems to activate the redstone while simultaneously placing a block but there is no block placement sound.

Probably caused by the fix for MC-161151.

Relates to MC-129112

Definitely does closely relate to MC-129112 - these are both cases of a block being placed successfully and playing a hand animation, but with the sound not playing.

Affects 19w46b

7 more comments
Keiren Waddell

Still present 20w19a

still an issue in 20w20b (no sound when standing, plays ok whilst crouching)

Confirmed on 20w21a

While looking into a bug that got reported to Mekanism about a similar issue with block placement sounds not being properly played I think I found the cause of this issue with redstone ore. Using my debugger I tracked it down to this block of code (in PlayerController#func_217292_a):

boolean flag = !p_217292_1_.getHeldItemMainhand().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_) || !p_217292_1_.getHeldItemOffhand().doesSneakBypassUse(p_217292_2_,blockpos,p_217292_1_);
boolean flag1 = p_217292_1_.isSecondaryUseActive() && flag;
if (event.getUseBlock() != net.minecraftforge.eventbus.api.Event.Result.DENY && !flag1) {
   ActionResultType actionresulttype = p_217292_2_.getBlockState(blockpos).onBlockActivated(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_);
   if (actionresulttype.isSuccessOrConsume()) {
      this.connection.sendPacket(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_));
      return actionresulttype;
   }
}

Looking at forge's patches the only part they added to the above snippet is the event result check. onBlockActivated for RedstoneOre is implemented as such:

 

if (worldIn.isRemote) {
   spawnParticles(worldIn, pos);
   return ActionResultType.SUCCESS;
} else {
   activate(state, worldIn, pos);
   return ActionResultType.PASS;
}

 

Which means that on the client it will always return success, thus having isSuccessOrConsume be true, and exiting the method func_217292_a. The placement sound code is lower down in that method where itemstack#onItemUse gets called so that BlockItem#tryPlace gets fired.

Jack McKalling

Confirm fixed in 1.16 pre3

tryashtar

Felix Jones

Confirmed

Normal

Sound

hand-animation

19w42a, 19w44a, 19w45b, 19w46b, 1.15 Pre-Release 2, ..., 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2

1.16 Pre-release 3

Retrieved