noeppi-noeppi / Bongo

A Minecraft Bingo Minigame Mod
https://www.curseforge.com/minecraft/mc-mods/bongo
Apache License 2.0
13 stars 20 forks source link

Add a leaderboard that update in real time instead of at the end #51

Open TBiscuit1 opened 2 years ago

TBiscuit1 commented 2 years ago

That's it

AudunVN commented 1 year ago

Been working on this for a bit in a fork, since I've wanted to have a realtime leaderboard for a while plus the option to have a player's current completed task count available for use in datapacks. This was so one could - for example - fairly easily make custom advancements or other things that happen depending on task count (such as #49) without needing to make changes to the user's mods each time.

From what I've tried so far vanilla MC scoreboards (see https://github.com/AudunVN/Bongo/commit/b7fcf0889997899f187d784a69dbc57ec05b6736, please note that the fork is still at 1.19.2) should likely work fairly well for implementing a real-time leaderboard, with the added bonus that it lets datapacks use and display the task counts if desired.

A 1.19.2 jar is available over here; displaying the scoreboard currently needs to be done through /scoreboard objectives setdisplay <display slot> bongo.tasks_completed , as I haven't quite decided where it would be best to set the default display options for the scoreboard yet (if anywhere). Depends a bit on whether one would want to have the leaderboard be adjustable client-side, in the bingo game settings, or per world.

Could likely make a pull request if those are welcome, thought I'd share what I've tried so far either way in case it'd be interesting/useful for somebody else.

Quick test screenshot with /scoreboard objectives setdisplay list bongo.tasks_completed and /scoreboard objectives setdisplay sidebar bongo.tasks_locked attached below, will likely mostly be using list bongo.tasks_completed myself since it's pretty unobtrusive. Haven't gotten as far as adding a way to list tasks per team instead of just per player quite yet, didn't think that far since I usually play with three-four people on separate teams so displaying it on the tab player list worked pretty well.

2023-05-28_00 51 22