mojira.dev
MC-302022

Experience Orbs desync after bouncing on lava

Experience Orbs temporarily desync after bouncing on lava.

This has been an issue for quite a while, but is very easy to see with the new debug flags.

Steps to Reproduce

  • Create a pool of lava

  • Spawn experience orbs on one side of it

  • Use their attraction to players to lure them into the lava

Expected Result

The orbs will not desync and jump around.

Actual Result

The orbs desync and jump around. See attached video.

Code Analysis

This is caused by experience orbs running non-deterministic movement code on both the client and server. Each side moves to a different location, temporarily desynchronizing them. When they next sync, the orb jumps to the correct location.

if (this.level().getFluidState(this.blockPosition()).is(FluidTags.LAVA)) {
  this.setDeltaMovement((this.random.nextFloat() - this.random.nextFloat()) * 0.2F, 0.2F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
}

Attachments

Comments 0

No comments.

Tropheus Jay

(Unassigned)

Unconfirmed

(Unassigned)

25w37a

Retrieved