The Bug:
Note blocks placed above honeycomb blocks in Java Edition don't play the flute instrument, unlike in Bedrock Edition.
Steps to Reproduce:
Launch the Java Edition version of the game and join a world.
Place a note block above a honeycomb block.
Activate the note block and take note of the instrument it plays.
Launch the Bedrock Edition version of the game and join a world.
Place a note block above a honeycomb block.
Activate the note block and take note of the instrument it plays.
Take note as to whether or not note blocks placed above honeycomb blocks in Java Edition play the flute instrument, just like in Bedrock Edition.
Observed Behavior:
Note blocks placed above honeycomb blocks in Java Edition don't play the flute instrument, unlike in Bedrock Edition.
Expected Behavior:
Note blocks placed above honeycomb blocks in Java Edition would play the flute instrument, just like in Bedrock Edition.
Code Analysis:
Code analysis by @unknown can be found in this comment.
Linked issues
relates to 1
Attachments
Comments 8
Can confirm in 21w40a. The expected behavior would be that note blocks would play the flute instrument when placed on top of honeycomb blocks.
The problem is that honeycomb blocks use the CLAY
material, and as it is not specified in NoteBlockInstrument
it returns the harp sound. This would be a potential fix:
net.minecraft.world.level.block.state.properties.NoteBlockInstrument (1.18.1, Mojang mappings)
...
public static NoteBlockInstrument byState(BlockState $$0) {
if ($$0.is(Blocks.CLAY) || $$0.is(Blocks.HONEYCOMB_BLOCK)) {
return FLUTE;
}
...
}
...
Alternatively, this conditional could be completely removed in favor of replacing it with a check for the CLAY
material instead of the blockstate:
...
Material $$1 = $$0.getMaterial();
if ($$1 == Material.CLAY) {
return FLUTE;
}
...
The side effect is that it would cause all blocks that use the CLAY
material to play the flute sound, and this could be undesirable.
Can confirm in 1.16.5.