Skip to content

Report accurate horse stats from compass - #38

Open
grepsedawk wants to merge 1 commit into
EdenMinecraft:mainfrom
grepsedawk:horse-stats-inaccurate
Open

Report accurate horse stats from compass#38
grepsedawk wants to merge 1 commit into
EdenMinecraft:mainfrom
grepsedawk:horse-stats-inaccurate

Conversation

@grepsedawk

@grepsedawk grepsedawk commented Jun 14, 2026

Copy link
Copy Markdown

Problem

The compass horse checker (right-click a horse with a compass) reported wrong stats:

  • Jump height came from a curve-fitted polynomial that was never accurate and drifted further from reality as jump strength rose. A boosted horse that actually reaches ~5.4 blocks (as shown by mods like Jade) was reported as 4.9.
  • Speed used a stale conversion constant.
  • All stats were read from the attribute base value, which hides modifiers from gear, potions, or other plugins.

Fix

  • Jump height: simulate the real jump instead of approximating. Each tick the horse rises by its velocity, then velocity falls by gravity (0.08) and is scaled by drag (0.98); the peak is the sum of the upward velocities. Verified against decompiled 1.21.x LivingEntity physics.

    jump strength old (polynomial) new (physics)
    0.5 1.62 1.71
    0.9 4.43 4.90
    0.955 4.90 5.46
    1.0 5.29 5.92
  • Speed: update the constant from 42.158 to 43.17037 (= 14.57 b/s ÷ 0.3375), matching the current horse speed table (4.86 / 9.71 / 14.57 b/s).

  • Effective values: read every stat via getValue() instead of getBaseValue(), so modifiers (gear, potions, other plugins) are reflected. FasterHorses sets the base value, so its speeds were already shown — this also covers modifier-based changes.

Module compiles.

The compass horse checker showed wrong numbers. Jump height came
from a curve-fitted polynomial that was never accurate and drifted
further from reality as jump strength rose: a horse that reaches
~5.4 blocks was reported as 4.9. Speed used a stale conversion
constant, and all stats were read from the attribute base value,
which hides modifiers from gear, potions, or other plugins.

Compute jump height by simulating the actual jump instead: each
tick the horse rises by its velocity, then velocity falls by
gravity (0.08) and is scaled by drag (0.98); the peak is the sum
of the upward velocities. Update the speed constant to match the
current horse speed table. Read every stat from the effective
attribute value so the displayed numbers match what the horse
actually does.
@grepsedawk
grepsedawk force-pushed the horse-stats-inaccurate branch from d92353b to fac10fa Compare June 14, 2026 11:02
@grepsedawk grepsedawk changed the title Compute horse jump height from jump physics Report accurate horse stats from compass Jun 14, 2026
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.

1 participant