Giter Site home page Giter Site logo

scoreboardapi's Introduction

ScoreboardAPI

I release the ScoreboardAPI for Nukkit 2.0! The old version of the ScoreboardAPI for nukkit 1.0+ is only available on GitHub.

To use the Scoreboard API for Nukkit 1.0 please use this version

--> https://github.com/LucGamesYT/ScoreboardAPI/releases/tag/1.0.0

Repository:

<repository>
    <id>public</id>
    <url>http://repo.lucgameshd.de/repository/maven-public</url>
</repository>

Dependency:

Nukkit 1.0:

<dependency>
    <groupId>de.lucgameshd</groupId>
    <artifactId>ScoreboardAPI</artifactId>
    <version>1.4</version>
</dependency>

Nukkit 2.0

<dependency>
    <groupId>de.lucgameshd</groupId>
    <artifactId>ScoreboardAPI</artifactId>
    <version>2.1</version>
</dependency>

Hot to use:

How to create a scoreboard:

Scoreboard scoreboard = ScoreboardAPI.createScoreboard();
ScoreboardDisplay scoreboardDisplay = scoreboard.addDisplay( DisplaySlot.SIDEBAR, "objectivename", "title" );

How to add a score:

scoreboardDisplay.addLine( "This is a line in a score", 0 );
scoreboardDisplay.addLine( "§a", 1 ); //free space
scoreboardDisplay.addLine( "Name: " + player.getName(), 2 );
scoreboardDisplay.addLine( "§b", 3); //free space
DisplayEntry positionEntry = scoreboardDisplay.addLine( "X: " + player.getFloorX() + " Y: " + player.getFloorY() + " Z: " + player.getFloorZ(), 4 );

How to remove a score:

DisplayEntry positionEntry = scoreboardDisplay.addLine( "X: " + player.getFloorX() + " Y: " + player.getFloorY() + " Z: " + player.getFloorZ(), 4 );
scoreboardDisplay.removeEntry( positionEntry );

How to set a scoreboard for the player:

ScoreboardAPI.setScoreboard( player, scoreboard );

How to remove the scoreboard:

ScoreboardAPI.removeScorebaord( player, scoreboard );

How to update a score:

scoreboardDisplay.removeEntry( positionEntry );
scoreboardDisplay.addLine( "X: " + player.getFloorX() + " Y: " + player.getFloorY() + " Z: " + player.getFloorZ(), 4 );

Important! The only thing I changed is the package. The package changes from "de.theamychan.scoreboard" to "de.lucgameshd.scoreboard" because I have a new username. The ScoreboardAPI for nukkit 1.0 is still the old package.

scoreboardapi's People

Contributors

lucgamesyt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.