Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

The Player Locator Bar seems to be slightly messed up.

Open TankObliterator opened this issue 5 months ago • 3 comments

Describe the bug

When a bedrock player joins a server if a player is outside that players render distance the bedrock locator bar will display an invalid location.

To Reproduce

Join a server with a bedrock and java account and compare the two locator bars.

Expected behaviour

The bedrock locator bar should show the same positions as its java counterpart. (Which are correct)

Screenshots / Videos

https://youtu.be/v2YF8dlZD4E

Server Version and Plugins

Proxy: Velocity 3.4.0-SNAPSHOT (git-81deb1ff-b521) Image

Server 1: This server is running Paper version 1.21.1-133-ver/1.21.1@3cb8529 (2025-03-28T16:14:36Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.20.6-151-a4f0f5c (MC: 1.20.6) Image

Server 2: (the one with the locator bar issue) This server is running Purpur version 1.21.7-2470-HEAD@8734844 (2025-07-05T02:53:44Z) (Implementing API version 1.21.7-R0.1-SNAPSHOT)

  • You are 2 version(s) behind Download the new version at: https://purpurmc.org/downloads Previous: 1.21.7-2468-2d8cdd1 (MC: 1.21.7) Image

Geyser Dump

https://dump.geysermc.org/gHBSCw2Ao22EIrTZEOhDKQBtuNskR38t

Geyser Version

2.8.2-b874 (git-master-57f0489)

Minecraft: Bedrock Edition Device/Version

Confirmed on Minecraft for Windows, Suspected on Minecraft for PS5 but waiting for confirmation.

Additional Context

The example video I linked was a rather poor demonstration as only one of the icons was messed up. Usually it is most if not all, with the exception of those within the render distance of the bedrock user.

TankObliterator avatar Jul 07 '25 01:07 TankObliterator

Unfortunately, it appears that this is hardcoded Bedrock client behavior - it chooses to display closeby players automatically, regardless if they're sent by the server.

onebeastchris avatar Aug 13 '25 00:08 onebeastchris

Yea but the close players weren't the problem, it was only the people further away that would have the wrong location displayed. When the player with the broken locator got close to any of the incorrectly displayed players the bar would fix itself and as far as I could tell, stay that way.

TankObliterator avatar Aug 13 '25 00:08 TankObliterator

Similar issue on my SMP. Bedrock locator bar is off by exactly 180 degrees when the other player is outside of render distance. When the other player comes within render distance the correct direction is shown on the bedrock player's locator bar. This suggests to me that perhaps when the other player is outside of render distance the locator bar is calculated server-side and the result would be sent to the bedrock client via a packet, and when the other player is within render distance the bedrock client does the logic for it client-side.

If this theory is true, this could possibly be fixed within Geyser, correct?

AuxAtlas avatar Nov 03 '25 17:11 AuxAtlas

When a given player is a far distance away from the geyser player, the packet sent to the geyser player simulates the other player at 1000 blocks away from the geyser player. It does this using an angle given by the packet.

However, this angle seems to be used incorrectly to estimate the other player's location, using the equation:

dx = cos(angle) * 1000 dz = -sin(angle) * 1000

Through testing, I placed the geyser player at 0,0 and the other player at various locations and recorded the reported angle. Below are my findings, in the format of (otherPlayerX, otherPlayerZ) => angle => (computed dx, computed dz):

(0, 1000) => 0 => (1000, 0) (0, -1000) => pi => (-1000, 0) (1000, 0) => pi/2 => (0, -1000) (-1000, 0) => -pi/2 => (0, 1000)

It seems that the correct equation for computing dx, dz should be: dx = sin(angle) * 1000 dz = cos(angle) * 1000

I will implement this locally and test this out further.

CodeAX2 avatar Dec 17 '25 18:12 CodeAX2

Doing slightly more testing,

dx = -sin(angle) * 1000 dz = cos(angle) * 1000

Seems to be correct (note the negation of sin)

CodeAX2 avatar Dec 17 '25 19:12 CodeAX2