Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/exodusdevs/scoreboard
A framework to create easy and fast scoreboards in PocketMine-MP
https://github.com/exodusdevs/scoreboard
Last synced: 2 months ago
JSON representation
A framework to create easy and fast scoreboards in PocketMine-MP
- Host: GitHub
- URL: https://github.com/exodusdevs/scoreboard
- Owner: ExodusDevs
- License: gpl-3.0
- Created: 2024-02-06T16:59:40.000Z (12 months ago)
- Default Branch: stable
- Last Pushed: 2024-03-31T13:34:54.000Z (10 months ago)
- Last Synced: 2024-03-31T14:24:07.468Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScoreboardLib
A framework to create easy and fast scoreboards in PocketMine-MP## How to use the Scoreboard API?
First declare the file as:
```php
use exodus\scoreboard\Scoreboard
```
Then create the instance with the 'Player Class' and 'Title', in this case ``Test Scoreboard``
```php
// must have class: pocketmine\player\Player
$scoreboard = Scoreboard::create($player, "Test Scoreboard");
```
Now spawn the scoreboard to add your line
```php
$scoreboard->spawn();
```
How do I add a line to the scoreboard? simple as this
```php
$scoreboard->setLine(0, "https://github.com/ExodusDevs");
```
You want to delete the scoreboard, do the following
```php
$scoreboard->remove();
```
Or do you want to delete a specific line? here is the code to remove it
```php
//You must go the number of the line you want to delete if you will not delete an incorrect line
$scoreboard->removeLine(0);
```
Or do you go for the easiest to, remove all lines? do this from once man
```php
$scoreboard->removeAllLine();
```
Or better you don't want to delete anything but add all the lines you want just once? I recommend this
```php
//remember this is in beta, I haven't tested it and I think it has bugs anyway open a pull request
$scoreboard->setAllLine([
"linea 1",
"linea 2",
"linea 3",
"wallenetwork.xyz"
]);```