Player Tracker is a CookieOS program that continuously polls every online player’s position and health, then renders the results onto an attached monitor peripheral. Players are automatically separated into Overworld and Nether columns so you can see at a glance where everyone is and how much health they have — updated every 5 seconds.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/PrinceOfCookies/CookieOS/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
All three of the following peripherals must be attached to the computer. If any one is missing, the “Player Tracker” entry in the Programs menu is shown in red text and the program exits immediately at startup.| Peripheral | Purpose |
|---|---|
chatBox | Required by the tracker to send fallback error messages when a player’s position cannot be retrieved |
monitor | The external display where coordinates are rendered |
playerDetector | Queries online players and returns real-time position, health, and dimension data |
Monitor Layout
When the program starts,monitor.setTextScale(0.5) is called to maximise information density. The display is then structured as follows:
- The “Overworld” header is centred horizontally at row 1.
- Overworld players are listed starting at row 3, one row each.
- The “Nether” header is placed below the last Overworld entry (offset by the total online player count + 4 rows).
- Nether players are listed immediately below the Nether header.
Update Interval
The tracker callssendPlayerCoords() inside a while true loop with os.sleep(5) between iterations, so the monitor is refreshed every 5 seconds. The monitor is fully cleared (monitor.clear()) at the start of each refresh to avoid stale entries from players who have logged off.
Dimension Detection
TheplayerDetector.getPlayerPos(player) call returns a table that includes a dimension field. The tracker checks this field to route each player to the correct column:
coords.dimension value | Column |
|---|---|
"minecraft:overworld" | Overworld section |
"minecraft:the_nether" | Nether section |
Core Logic
getPlayerPos returns nil for a player (for example, because they are in an unsupported dimension or the mod cannot locate them), a fallback message is sent via the chatBox peripheral:
The monitor’s text scale is forced to 0.5 at startup to fit as many players as possible. At this scale, a standard 2×2 monitor is recommended for servers with more than a handful of online players. If the player list exceeds the monitor’s height, entries will overflow off-screen.