Most rideable entity statistic trackers (xxxx_one_cm) do not track movement correctly
A pull request for this has already been merged.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
Rideable entities, such as:
-
Minecarts (minecart_one_cm)
-
Striders (strider_one_cm)
-
Pigs (pig_one_cm)
-
Boats (boat_one_cm)
-
Horses (horse_one_cm)
each have a statistic for tracking how far a player moves while riding them. Most of these don't track this statistic correctly. -
Minecarts function correctly.
-
Striders should accurately track how far a player moves while riding them regardless of velocity or if the strider is being controlled with a fungus on a stick.
-
Pigs should also accurately track this, regardless of velocity or if the pig is being controlled with a carrot on a stick.
-
Boats should correctly track this statistic based on if the player is or isn't moving the boat, as well as how fast that player is going.
-
Horses should also take into account if the player is moving at all, and how fast/slow that player may be moving.
Observed/Actual behavior
While Minecarts work as expected and in parity with Vanilla Minecraft, the rest of the rideable entities do not.
"Works as intended" in all cases means that:
- If the entity you're riding isn't moving, your stat does not increase, AND
- If the entity you're riding IS moving, your stat does increase, AND
- Your statistic increases dependent on how far/fast the entity your riding moves
Minecart:
Vanilla: Works as intended
Paper: Works as intended
Strider:
Vanilla: Works as intended
Paper: Broken. If you get on the strider while not holding a "fungus on a stick", it will seemingly calculate the correct distance that the strider moves while you're riding it. If you pull out a fungus stick however, the stat will increase by a constant amount, even if that strider changes speed or is not moving because it's stuck.
Pig:
Vanilla: Works as intended
Paper: Broken. If you get on the pig while not holding a "carrot on a stick", it will seemingly calculate the correct distance that the pig moves while you're riding it. If you pull out a carrot stick however, the stat will increase by a constant amount, even if that pig changes speed or is not moving because it's stuck.
Boat:
Vanilla: Works as intended
Paper: Broken. The stat increases by a consistent amount (45 p/ tick) no matter what you're doing with the boat, even if you're not moving. The stat does not change based on motion whatsoever, it just constantly increases by 45 every tick.
Horse:
Vanilla: Works as intended
Paper: Broken. The stat increases by a constant amount (85 p/ tick) even if you're not moving. If you jump with the horse, your stat briefly increases up to 122 p/ tick, before falling back down to 85.
Steps/models to reproduce
I've done my best to explain the issue and what to observe in detail in this video, hope it helps:
https://www.youtube.com/watch?v=ZqKOwTL9DbE
This issue requires no prior setup and should be immediately visible once you're viewing the relevant affected statistic.
Plugin and Datapack List
pl
[20:13:21 INFO]: Plugins (0):
datapack list
[20:13:31 INFO]: There are 2 data packs enabled: [vanilla (built-in)], [file/bukkit (world)]
[20:13:31 INFO]: There are no more data packs available
Paper version
version
[20:12:51 INFO]: This server is running Paper version git-Paper-36 (MC: 1.18) (Implementing API version 1.18-R0.1-SNAPSHOT) (Git: 76ee105)
You are running the latest version
Previous version: git-Paper-32 (MC: 1.18)
Other
I found a Spigot ticket that discusses this issue from 6 months ago and it looks like it's abandoned. https://hub.spigotmc.org/jira/browse/SPIGOT-6475
One comment says they made a PR for it but the ticket is still open as unresolved and this issue still obviously persists.
According to md_5 in the same ticket, this issue goes back to at least Minecraft 1.13.2, I've been able to reproduce it on:
- Spigot 1.18
- Paper 1.17 build 391
- Paper 1.18 build 32
- Paper 1.18 build 36
This is not reproduceable in Vanilla Minecraft 1.18.
Here's the scoreboard commands so you don't need to type them out smile :^)
Minecart:
/scoreboard objectives add minecart_one_cm minecraft.custom:minecraft.minecart_one_cm
/scoreboard objectives setdisplay sidebar minecart_one_cm
Strider:
/scoreboard objectives add strider_one_cm minecraft.custom:minecraft.strider_one_cm
/scoreboard objectives setdisplay sidebar strider_one_cm
Pig:
/scoreboard objectives add pig_one_cm minecraft.custom:minecraft.pig_one_cm
/scoreboard objectives setdisplay sidebar pig_one_cm
Boat:
/scoreboard objectives add boat_one_cm minecraft.custom:minecraft.boat_one_cm
/scoreboard objectives setdisplay sidebar boat_one_cm
Horse:
/scoreboard objectives add horse_one_cm minecraft.custom:minecraft.horse_one_cm
/scoreboard objectives setdisplay sidebar horse_one_cm
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the affected statistics with the listed scoreboard objectives, especially strider_one_cm, pig_one_cm, boat_one_cm, and horse_one_cm, while comparing stationary and moving rides. Review the closed pull requests 7033 and 8274 before starting. Done means each statistic increases only while the ridden entity moves and reflects the distance traveled, matching Vanilla Minecraft.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100