PaperMC / PaperMC/Paper

Wandering Trader leash desync when re-entering tracking distance

Open
#14,049 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted version: 26.2
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Given the following setup:

  1. A wandering trader spawns with two llamas, only one is required for this example
  2. One llama is 4 blocks closer to the player compared to the trader

If the player moves far enough for the trader (that is slightly farther away than the llama) to not being tracked, but still keeps the llama within tracking distance, when the player comes closer to make the trader appear again, the leash will connect back to the wandering trader.

Observed/Actual behavior

If the player moves far enough for the trader to not being tracked, but still keeps the llama within distance, when the player comes closer to make the trader appear again, the leash will be stuck on the air in the same position the trader was before going out of tracking distance.

Steps/models to reproduce
  1. Load the following world with Paper 26.2 build 56 (jar not included):
    server.zip

  2. Fly to the platform with the trader and their llama.

  3. Fly far enough to only get the trader to not be tracked, there's a diamond platform in the distance for reference

  4. Fly back to the platform with the trader

  5. See the desync

Plugin and Datapack List

No plugins nor datapacks

Paper version

Paper 26.2 build 56

Other

Possibly related issues as pointed out by Amaranth in discord, but not quite the same issue:
https://mojira.dev/MC-153980
https://mojira.dev/MC-144312

I haven't been able to re-create this neither in Vanilla nor in Fabric+Moonrise.
Paper has logic to re-attach a leashed entity to their leasher when they enter tracking distance.
However, it doesn't seem to be any logic that does the opposite, re-sync the leasher to its leashed entities (vanilla and moonrise don't seem to have logic for that either, it's weird).

https://github.com/user-attachments/assets/3ad0ef63-9d46-4275-b977-297970e76e36

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by loading the attached server.zip on Paper 26.2 build 56 and reproduce the trader-and-llama tracking-distance scenario. Then inspect Paper's leash reattachment logic for entities entering tracking distance and determine how the leasher should be resynchronized when only its leashed entity remains tracked. Done means the leash reconnects to the trader after it reappears without affecting other leash behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.