The Bug
Weighted pressure plates made out of metal make the wood sounds for breaking and placing. This occurs in both survival and creative mode.
Expected Result
It would make the metal noises for placing and breaking the block.
Observed Result
It made the wood noise for placing and breaking the block.
How to Reproduce
1. Place Weighted pressure plates to hear the wood place sound occur.
2. Destroy Weighted pressure plates to hear the wood break sound occur.
Code analysis
Code analysis by @unknown in this comment.
Linked issues
is duplicated by 15
relates to 2
Attachments
Comments 31
Is this still a concern in the latest Minecraft version 14w08a? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
I can confirm this behavior in 1.18 Release Candidate 3.
Here's a code analysis along with a potential fix regarding this issue. The following is based on a decompiled version of Minecraft 1.17.1 using MCP-Reborn.
Code Analysis:
net.minecraft.world.level.block.Blocks.java
public class Blocks {
...
public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register("light_weighted_pressure_plate", new WeightedPressurePlateBlock(15, BlockBehaviour.Properties.of(Material.METAL, MaterialColor.GOLD).requiresCorrectToolForDrops().noCollission().strength(0.5F).sound(SoundType.WOOD)));
public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register("heavy_weighted_pressure_plate", new WeightedPressurePlateBlock(150, BlockBehaviour.Properties.of(Material.METAL).requiresCorrectToolForDrops().noCollission().strength(0.5F).sound(SoundType.WOOD)));
...
If we look at the above class, we can see that light and heavy weighted pressure plates utilize the .sound(SoundType.WOOD)
method which is used for determining whether a block should produce wood sounds.
Potential Fix:
Simply replacing the .sound(SoundType.WOOD)
method with .sound(SoundType.METAL)
within these lines of code should resolve this problem, as light and heavy weighted pressure plates are predominantly constructed of metal. The correct lines of code within their class should look something like the following:
net.minecraft.world.level.block.Blocks.java
public class Blocks {
...
public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register("light_weighted_pressure_plate", new WeightedPressurePlateBlock(15, BlockBehaviour.Properties.of(Material.METAL, MaterialColor.GOLD).requiresCorrectToolForDrops().noCollission().strength(0.5F).sound(SoundType.METAL)));
public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register("heavy_weighted_pressure_plate", new WeightedPressurePlateBlock(150, BlockBehaviour.Properties.of(Material.METAL).requiresCorrectToolForDrops().noCollission().strength(0.5F).sound(SoundType.METAL)));
...
Confirmed.