[Open Source] - Scoreboard API

NV6

the opensource person(?)
Premium
Feedback score
8
Posts
383
Reactions
223
Resources
1
Scoreboard API
This is an opensource scoreboard api, which is pretty lightweight and easy to use.

(taken from README.md on github repository)
### Registering the handler itself:
Replace "ScoreboardImpl" with the ScoreboardElementHandler you're using (this is where the scoreboard api gets the elements from.)

Code:
@Override
public void onEnable() {
    new ScoreboardHandler(this, ScoreboardImpl(), 20L);
}

Making a new ScoreboardElementHandler implementation

Code:
import io.github.nosequel.scoreboard.element.ScoreboardElement;
import io.github.nosequel.scoreboard.element.ScoreboardElementHandler;

public class ScoreboardImpl implements ScoreboardElementHandler {

    /**
     * Get the scoreboard element of a player
     *
     * @param player the player
     * @return the element
     */
    @Override
    public ScoreboardElement getElement(Player player) {
        final ScoreboardElement element = new ScoreboardElement();
     
        element.setTitle("Example Title");
        element.add(player.getName());
     
        if(player.getLocation().getX() >= 50) {
            element.add("your X axis is higher than 50");
        }
     
        return element;
    }
}
68747470733a2f2f692e696d6775722e636f6d2f767165334738642e706e67

Prices
- Fully opensource, and free to use.
https://github.com/NoSequel/ScoreboardAPI

Test Server
There is currently no real test server up, however I can startup a small test server on request, however it's recommended to just test it out yourselves - since it's free and opensource.

Bug Policy
Report any bugs to the owner (NV6) or on the github repository.
 
Type
Offering
Top