mojira.dev
MC-266430

Breeze on top of a non-full block produces particles of the block below it

The bug

Breeze on top of a non-full block produces particles of the block below it.

To reproduce

  • Place a white concrete block.

  • Place a block of mud on top of it.

  • Spawn a breeze on top of the mud block.

Expected result

The breeze would create mud particles.

Observed result

The breeze creates white concrete particles.

Code analysis

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

Related issues

Attachments

Comments

migrated
[media][media][media][media][media]
[Mod] Jingy

Code analysis (Mojang mappings, 23w45a):

Both emitJumpTrailParticles() and emitGroundParticles() inside Breeze.java get the block position directly below the entity's currenty `y` position for which particle to display. This does not account for if the entity is standing on top of anything other than a full block, (or nothing at all for that matter) so the result can be incorrect in some cases as shown.

BlockState blockState = this.level().getBlockState(this.blockPosition().below());

The fix for this is simple, change the used blockstate to be the 'onPos' for the entity (The block the entity is directly standing on rather than the block below them) like so:

BlockState blockState = this.level().getBlockState(this.getOnPos());

This fix provides the following:
(Notice the correct sculk particles, and lack of particles for the floating Breeze)

[media]

Note:

The particles can also be emitted if the breeze is above another block, but not standing on anything as shown:

[media]

[Mod] Jingy

This can also occur when the breeze is riding an entity:

[media]

ampolive

v-hjonson+bugs

1139904

Confirmed

Expansion B

Normal

Particles

breeze

23w45a, 23w46a, 1.20.3 Pre-Release 1, 1.20.3 Pre-Release 2, 1.20.3 Release Candidate 1, 1.20.4

23w51a

Retrieved