Skip to content

Conversation

@SaolGhra
Copy link

Clamp per-axis velocities to [-4.0, 4.0] for non-projectile / non-minecart entities in CraftEntity#setVelocity.

  • Preserve the existing CraftServer.excessiveVelEx owner-warning for unsafe velocity attempts.
  • Add a small clamp(double, min, max) helper and mark the change with Paper patch comments.
  • Projectiles and minecarts are intentionally unchanged.

This prevents plugins from applying extreme velocities (e.g. new Vector(0, 100, 0)) that can cause inconsistent or explosive player launches and server-side instability.

Fixes: #13270

…used explosive launches (PaperMC#13270)

- Clamp per-axis velocities to [-4.0, 4.0] for non-projectile/non-minecart entities in CraftEntity#setVelocity.
- Preserve existing CraftServer.excessiveVelEx warning when unsafe velocities are attempted.
- Add a small clamp helper.

This prevents plugins from causing inconsistent or extreme player launches while keeping projectiles/minecarts unchanged.
Tested with local runDev and test-plugin harness to confirm NMS deltaMovement is clamped to 4.0.
@SaolGhra SaolGhra requested a review from a team as a code owner November 20, 2025 15:55
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Nov 20, 2025
@Warriorrrr
Copy link
Member

Welcome to paper!

Unfortunately, I don't think this is quite the right fix for this issue, velocities above/below (-)4 are valid and shouldn't be clamped here like that. I think some more discussion would be useful in the original issue how/if we want to fix this, the root issue is trivially fixable on the plugin's side at least.

Thank you for your contribution regardless.

@Warriorrrr Warriorrrr closed this Nov 21, 2025
@github-project-automation github-project-automation bot moved this from Awaiting review to Closed in Paper PR Queue Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

setVelocity bug in 1.21.10

2 participants