mojira.dev
MC-212976

Parity issue: Note blocks placed above honeycomb blocks don't play the flute instrument

The Bug:

Note blocks placed above honeycomb blocks in Java Edition don't play the flute instrument, unlike in Bedrock Edition.

Steps to Reproduce:

  1. Launch the Java Edition version of the game and join a world.

  2. Place a note block above a honeycomb block.

  3. Activate the note block and take note of the instrument it plays.

  4. Launch the Bedrock Edition version of the game and join a world.

  5. Place a note block above a honeycomb block.

  6. Activate the note block and take note of the instrument it plays.

  7. 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

Attachments

Comments 8

Can confirm in 1.16.5.

Can confirm in 1.17.

Can confirm in 1.17.1.

Shouldn't this also be in the Sound category, besides Parity?

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.

bugsbugsbugs

Avoma

(Unassigned)

Confirmed

Gameplay

Normal

Block states, Parity, Sound

note_block, vanilla-parity

21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, ..., 1.20.2, 1.21, 1.21.3, 1.21.4, 1.21.7

Retrieved