Skip to content

Fix EntityLiving every-other-tick collision skip schedule - #198

Open
xii69 wants to merge 4 commits into
Wind-Development:masterfrom
xii69:fix/living-collision-skip-schedule
Open

xii69 wants to merge 4 commits into
Wind-Development:masterfrom
xii69:fix/living-collision-skip-schedule

Conversation

@xii69

@xii69 xii69 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Non-player living entities still skip pushing each other every other tick (old CraftBukkit perf). The gate used ticksLived % 2, which is tied to when the mob spawned. Two mobs can both skip or both push on the same tick, and it drifts under activation-range ticking. The TODO literally asked if we had a better check now.

What this changes

Keep the half-rate skip (intentional on this fork — we’re not doing full SPIGOT-1994 removal), but schedule it on MinecraftServer.currentTick so all non-players share one clock. Players never skip.

Why this is needed

Spawn-parity skipping makes mob-mob collision uneven and harder to reason about with EAR. A global tick schedule keeps the optimization without the weird pairing.

Testing

LivingEntityCollisionSkipTest 5/5; server suite green; package OK.

@kalibrieren

kalibrieren commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

In your PRs, please keep the diff minimal.
That means, e.g. don't create new classes for checks (like here) if you're only using it once - in that case just inline it - we have the // WindSpigot comments.

Also pay attention to code quality & clarity. Overall just avoid useless shit that AI adds that a human wouldn't.

Replace CraftBukkit ticksLived % 2 gate with MinecraftServer.currentTick
so all non-players share one intentional half-rate schedule. Players still
never skip. Inline the check in EntityLiving (no one-use helper class).

Co-authored-by: xii69 <xii69@yahoo.com>
@cursor
cursor Bot force-pushed the fix/living-collision-skip-schedule branch from f702003 to 0d6e236 Compare October 14, 2026 17:32
Co-authored-by: xii69 <xii69@yahoo.com>
@cursor
cursor Bot force-pushed the fix/living-collision-skip-schedule branch from 0d6e236 to 617100b Compare October 14, 2026 21:11
…edule

Correct "Fix EntityLiving every-other-tick collision skip schedule"
@windcolor-dev

Copy link
Copy Markdown
Member

Isn't it better to base it on this.ticksLived % 2?

That way there's a bit of randomness. With the change you're proposing, every collision would run on the same ticks instead of being spread out

@kalibrieren

Copy link
Copy Markdown
Contributor

Isn't it better to base it on this.ticksLived % 2?

That way there's a bit of randomness. With the change you're proposing, every collision would run on the same ticks instead of being spread out

True, would likely be better - especially to keep the Vanilla behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants