Skip to content

Add tablist API for player list data - #78

Open
jkramer5103 wants to merge 1 commit into
maxuser0:mainfrom
jkramer5103:feature/tablist-api
Open

Add tablist API for player list data#78
jkramer5103 wants to merge 1 commit into
maxuser0:mainfrom
jkramer5103:feature/tablist-api

Conversation

@jkramer5103

Copy link
Copy Markdown
Contributor

Summary

  • add minescript.tablist() backed by the network entries used by Minecraft's player-list overlay, so server-created fake players are included
  • expose each entry's profile and display names, UUID, latency, game mode, team, ordering, skin data, hat state, and optional list score
  • expose the tab-list header, footer, and optional scoreboard objective
  • preserve displayed text as both convenient plain text and structured Minecraft JSON
  • support Python and Pyjinn, with generated API documentation and integration coverage

Usage

current_tablist = minescript.tablist()

players = current_tablist.players()
header_lines = (
    [] if current_tablist.header() is None
    else current_tablist.header().lines()
)
footer = (
    None if current_tablist.footer() is None
    else current_tablist.footer().plain
)

Live example

Tested on Donut SMP with Minecraft 26.2 and Fabric:

Tablist entries: 80
Header: '\nDonut SMP\n17.4K Players\n'
Footer: '\n$ 1.7B • 37 ms\n'
First entries: w00summer, N1ckifyy, 1sand, AhuvadeDih, BabyBeastpont, BurlyCloud_, Clxudyscute, Dkockysnoot_, Eljook, Enderscore24

This demonstrates that the API returns the server-created tab entries as well as the multiline header and footer status text.

Validation

  • Fabric 26.2 build
  • NeoForge 26.2 build
  • Python and Pyjinn syntax compilation
  • tab-list result transformation test with fake-player, multiline-header, and footer data
  • in-game Fabric test against a real server tab list
  • git diff --check

The Forge build could not resolve the repository's configured net.minecraftforge:forge:26.2-60.0.0:userdev dependency; the shared implementation compiled successfully through both Fabric and NeoForge.

Fixes #77.

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.

feature: allow accessing the tablist from python

1 participant