ScoreboardStatsX

ScoreboardStatsX

3M Downloads

API to create new scoreboards

LuisUrrutia opened this issue ยท 4 comments

commented

I'm a developer, and i'm trying to show my custom sidebar when someone is in the game, but i wanna restore the original scoreboard when he left the game. Actually i had the custom sidebar (scoreboard) but i can restore the original (with compatibility mode)
I tried in so many ways and nothing works.

This is what i have when a player left the game

        scoreboardStats.getRefreshTask().remove(player);
        sbmanager.unregister(player);
        sbmanager.createScoreboard(player);
        scoreboardStats.getRefreshTask().addToQueue(player);
commented

How do you set your scoreboard?
Is it the main scoreboard?

Actually if you add offline players to the refreshtask they will be ignored, because scoreboards shouldn't be saved in order to clean up after the plugin disables.

commented

Hi, well i solved it, my problem was this:
I'm making a plugin and i want to create a custom scoreboard for my game (btw should be an api for this, 'cause i do that by the hard way.. custom title, players name in the scoreboard, etc) and when they left the game, i want to restore the original scoreboard, and in order to do that i use this code:

player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
sbmanager.createScoreboard(player);
commented

Actually, I'm working on an API. What do you expect from the it?

commented

well basically that we can create custom scoreboard easily, like set a custom title, and custom scores, i mean, in your plugin actually we can add custom fields and values to the scoreboard (if i'm not wrong) but we can't call a method to change the title, erase the content, and set/update custom fields/values... or create an object, maybe by Inheritance, to create a custom scoreboard.
I'm not good with english.