Cloudburst icon indicating copy to clipboard operation
Cloudburst copied to clipboard

Breaking blocks doesn't add break sound & particles

Open Poswn opened this issue 2 years ago • 0 comments

Expected Behavior

Breaking a block will play a sound and show particles of where block was broken.

Actual Behavior

No sound played or particles shown.

Steps to Reproduce

Go into creative mode (can't break any blocks in survival for some reason) and break a block.

Debug information

I dug into this a bit myself and it seems be from this piece of code (or look at code I copied below) where chunk.getPlayerLoaders() in fact is empty.

This code snippet is taken from here.

if (createParticles) {
    Chunk chunk = this.getLoadedChunk(target.getPosition());
    if (chunk != null) {
        this.addParticle(new DestroyBlockParticle(target.getPosition().toFloat().add(0.5, 0.5, 0.5), target.getState()), (Collection<Player>) chunk.getPlayerLoaders());
    }
}

Poswn avatar Jan 21 '22 14:01 Poswn