Skip to content

Added Scoreboard Query Function - #56

Open
jkramer5103 wants to merge 2 commits into
maxuser0:mainfrom
jkramer5103:feature-scoreboard
Open

Added Scoreboard Query Function#56
jkramer5103 wants to merge 2 commits into
maxuser0:mainfrom
jkramer5103:feature-scoreboard

Conversation

@jkramer5103

Copy link
Copy Markdown
Contributor

I added the function: get_scoreboard(), which gets the current content of the scoreboard, this is an example output recorded one mcpvp.club:

ScoreboardData(objective_name='{MINECRAFT_USERNAME}-SB', display_name='PVP CLUB', entries=[ScoreboardEntry(name='§a§5§b§0§r', score=9, display_name=' '), ScoreboardEntry(name='§a§5§b§1§r', score=8, display_name='â\udc8fº {MINECRAFT_USERNAME} (EU)'), ScoreboardEntry(name='§a§5§b§2§r', score=7, display_name=' '), ScoreboardEntry(name='§a§5§b§3§r', score=6, display_name='Use 🗡 to queue,'), ScoreboardEntry(name='§a§5§b§4§r', score=5, display_name='or /duel to duel.'), ScoreboardEntry(name='§a§5§b§5§r', score=4, display_name=' '), ScoreboardEntry(name='§a§5§b§6§r', score=3, display_name='⌚ 12/29/2025'), ScoreboardEntry(name='§a§5§b§7§r', score=2, display_name='→ eu-spawn6 (80ms)'), ScoreboardEntry(name='§a§5§b§8§r', score=1, display_name=' '), ScoreboardEntry(name='§a§5§b§9§r', score=0, display_name='mcpvp.club')])

It looks pretty cursed, but that is the content of the scoreboard, with the colors and everything.

@jkramer5103

Copy link
Copy Markdown
Contributor Author

Hello, is this Repo still maintained?

@DogeDev67

Copy link
Copy Markdown

Holy yes please add this. I sent an email a while ago asking about the scoreboard.

@jkramer5103

Copy link
Copy Markdown
Contributor Author

Yea I submitted this PR in Late December and still havent heard back, idk if maxuser looks at the PR's, did you get an answer to your mail?

@DogeDev67

Copy link
Copy Markdown

sorry for the late response. Unfortunately no response.

@maxuser0

Copy link
Copy Markdown
Owner

Please update test/minescript_test.py with a test function for get_scoreboard():

https://github.com/maxuser0/minescript/blob/main/test/minescript_test.py

Also, please give more detail in the commit description with an example like you did at the start of this comment thread.

@maxuser0 maxuser0 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go into the next beta, 5.0b12.

`ScoreboardData` with objective name, display name, and list of entries,
or `None` if no scoreboard is displayed on the sidebar.

Since: v5.1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v5.0 is still in beta, so please change to: Since: v5.0

`ScoreboardData` with objective name, display name, and list of entries,
or `None` if no scoreboard is displayed on the sidebar.

Since: v5.1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: © 2022-2025 Greg Christiana <maxuser@minescript.net>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the copyright year to 2026.

@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: © 2022-2025 Greg Christiana <maxuser@minescript.net>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Expose get_scoreboard() in the Python and Pyjinn APIs. The query returns the sidebar objective name, display name, and entries in descending score order, including each entry's rendered display text.

Example result:

ScoreboardData(objective_name='player-SB', display_name='PVP CLUB', entries=[ScoreboardEntry(name='line0', score=1, display_name='mcpvp.club')])

Add an integration test covering empty sidebars and the returned scoreboard data shape.
# Conflicts:
#	common/src/main/resources/system/lib/minescript.py
#	common/src/main/resources/system/pyj/minescript.py
@jkramer5103

Copy link
Copy Markdown
Contributor Author

Should be ready

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.

3 participants