A Pocketmine-MP (PMMP) leaderboard plugin that shows player statistics on a website.

Overview

WebLeaderBoard

A Pocketmine-MP (PMMP) leaderboard plugin that shows all sorts of statistics on a website.

Setup Guide

  1. To start using the plugin, download the WebLeaderBoard.phar file from poggit and put it into your server's plugins folder.
  2. Then you can edit the config.yml file to your liking which can be found in the plugins_data/WebLeaderBoard folder.
  3. After that, all you have to do is start your server and go to https://webleaderboard.pythonanywhere.com/ and search for your server.

Support

Join the discord server for quick questions.
For issues and suggestions, please create an issue on Github. Please provide as much details for bug reports. If there is a error report in your console, please copy paste it in the issue.

FAQ

How can I add more stats to my servers page on the website?
To add a custom statistics page with statistics from another plugin, you must nicely ask that plugin's developper to support this plugin. They must follow the developpers guide below.

Developers

If you are a plugin developer and would like to add support for your own stats page to the website, please follow this guide.
NOTE: This page will only appear for servers using your plugin.

  1. The first step is to import these classes (just copy paste this):
use Max\WebLeaderBoard\{RequestPagesEvent, SendDataEvent};
  1. You need to create the page. For this you need to supply the required information.
    To do this, you must use the RequestPagesEvent event. So simply copy paste this code into your EventListener or any class with the pocketmine Listener implemented.
    Then you need to replace the:
  • PAGE_NAME -> the name of the page on the website. (NO SPACES! Only 1 word. Example: SkyBlock)
  • PAGE_TITLE -> the title of the stats page. (Example: SkyBlock Stats)
  • PAGE_TITLE_1-4 -> the titles of each data entry in the table on the website. (Example: Rank)
  • TABLE_DEFAULT_VALUE_1-4 -> the default value of each data entry in the table on the website that will only be shown when nothing is set yet. (Example: 0)
  • PAGE_ICON_LINK -> a link to an image that will be used at the icon for your page. (Example: https://bit.ly/3lIhWjH)
    public function onRequestPagesEvent(RequestPagesEvent $event) {
        $event->setPage(
            "PAGE_NAME",
            "PAGE_TITLE",
            [	
                "TABLE_TITLE_1" => "TABLE_DEFAULT_VALUE_1", 
                "TABLE_TITLE_2" => "TABLE_DEFAULT_VALUE_2", 
                "TABLE_TITLE_3" => "TABLE_DEFAULT_VALUE_3", 
                "TABLE_TITLE_4" => "TABLE_DEFAULT_VALUE_4"
            ],
            "PAGE_ICON_LINK"
        );
    }
  1. Now that your page is set and will appear on the website (only pages of servers that have your plugin installed), you need to make these stats update!
    To do this you will have to use the setPageStat function. Copy the code below and replace the following:
  • PAGE_NAME -> the same page name used in step 2. (EXACTLY THE SAME NAME!)
  • PLAYER_NAME -> the name of the player who's stat you want to change.
  • TABLE_TITLE -> the title of the data entry which you want to change.
  • TABLE_VALUE -> the value you want to set.

    NOTE: If you only want to update your pages stats every time the website's info reloads, you can use the SendDataEvent which is only called every time the website's info is reloaded (Example of this on step 4).
Server::getInstance()->getPluginManager()->getPlugin("WebLeaderBoard")->setPageStat("PAGE_NAME", "PLAYER_NAME", "TABLE_TITLE", "TABLE_VALUE");
  1. Done! If you still have any questions please look at this working example implementing a RedSkyBlock stats page:
<?php

declare(strict_types=1);

namespace Max\WebRedSkyBlock;

use pocketmine\plugin\{Plugin, PluginBase};
use pocketmine\event\Listener;
use pocketmine\Server;

use Max\WebLeaderBoard\{RequestPagesEvent, SendDataEvent};

class Main extends PluginBase{
    public function onEnable() {
    	#Making sure that WebLeaderBoard plugin is installed:
    	if ($this->getServer()->getPluginManager()->getPlugin("WebLeaderBoard") instanceof Plugin) {
            $this->getServer()->getPluginManager()->registerEvents(new WebLeaderBoardListener($this), $this);
    	}
    }
}

class WebLeaderBoardListener implements Listener {
    public function onRequestPagesEvent(RequestPagesEvent $event) {
        $event->setPage("RedSkyBlock", "SkyBlock Stats", ["Island Name" => "N/A", "Island Size" => "N/A", "Island Value" => "N/A", "Island Rank" => "N/A"], "https://raw.githubusercontent.com/RedCraftGH/RedSkyBlock/master/icon.png");
    }

    public function onSendDataEvent(SendDataEvent $event) {
        $WebLeaderBoard = Server::getInstance()->getPluginManager()->getPlugin("WebLeaderBoard");
        $RedSkyBlock = Server::getInstance()->getPluginManager()->getPlugin("RedSkyBlock");

        foreach (Server::getInstance()->getOnlinePlayers() as $player) {
            $WebLeaderBoard->setPageStat("RedSkyBlock", $player->getName(), "Island Name", (string)$RedSkyBlock->getIslandName($player));
            $WebLeaderBoard->setPageStat("RedSkyBlock", $player->getName(), "Island Size", (string)$RedSkyBlock->getIslandSize($player));
            $WebLeaderBoard->setPageStat("RedSkyBlock", $player->getName(), "Island Value", (string)$RedSkyBlock->getIslandValue($player));
            $WebLeaderBoard->setPageStat("RedSkyBlock", $player->getName(), "Island Rank", (string)$RedSkyBlock->getIslandRank($player));
        }
    }
}

Contact me on discord ItsMax123#6798 if you need any help intergrating this into your plugin.

You might also like...
A plugin manager for PocketMine-MP downloads plugin from PocketMine-MP official plugin repository

oh-my-pmmp A plugin manager for PocketMine-MP Getting Started Prerequisites Your server MUST RUN the latest version of PocketMine. Installation From P

Powerful land plugin, based on PMMP.

iLand Powerful land plugin, based on PMMP Features Land management with Form UI The border of the selected land Custom land settings Customize the per

Powerful land plugin, based on PMMP.

iLand Powerful land plugin, based on PMMP Features Land management with Form UI The border of the selected land Custom land settings Customize the per

Statistics of server growth

Growth Server growth statistics plugin by NhanAZ for PocketMine-MP Contacts You can contact me directly through the platforms listed below Platform Co

PHP package that provides functions for calculating mathematical statistics of numeric data
PHP package that provides functions for calculating mathematical statistics of numeric data

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

PHP package that provides functions for calculating mathematical statistics of numeric data.
PHP package that provides functions for calculating mathematical statistics of numeric data.

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

Surftimer-Web-Stats is Web with surftimer statistics.

Surftimer-Web-Stats v2 Surftimer-Web-Stats is Official Web with statistics for Surftimer-Official. Features: Dashboard with TOP players and recent Rec

PMMP 4.0.0

InventoryAPI PocketMine-MP APIv4.0.0 Example OneBlockInventory use pocketmine\block\BlockLegacyIds; use pocketmine\player\Player; use pocketmine\netw

Owner
ItsMax123
PocketmineMP plugin dev. & ex-Website dev. (PHP, HTML, CSS, JavaScript, Python)
ItsMax123
A PHP script that converts PMMP-3 Plugins into PMMP-4 plugins

This script tries to convert pm3 plugins to pm4 as good as possible, but sadly not perfect. Please open issues if you find any unexpected behaviour, to help improving this script.

null 43 Dec 3, 2022
Server growth statistics plugin by NhanAZ for PocketMine-MP

General Server growth statistics plugin by NhanAZ for PocketMine-MP Contacts You can contact me directly through the platforms listed below Platform C

NhanAZ's PocketMine-MP Plugins 1 Dec 18, 2021
A Pocketmine-MP (PMMP) plugin to help staff members enforce the rules of the server.

StaffMode is an all-in-one Pocketmine-MP (PMMP) moderation plugin made to simplify the life of staff members.

ItsMax123 9 Sep 17, 2022
A Pocketmine-MP (PMMP) plugin to prevent players from doing most glitches.

AntiGlitch AntiGlitch is an all-in-one Pocketmine-MP (PMMP) plugin made to prevent as many known glitches. Setup Guide To start using the plugin, down

ItsMax123 12 Sep 17, 2022
A plugin OreSpawner for PocketMine-PMMP

A plugin OreSpawner for PocketMine-PMMP

VennV 2 Oct 9, 2022
SpawnInLobby Pocketmine-MP plugin. With this plugin the player will always join the game at the default world spawn point

SpawnInLobby Pocketmine-MP plugin. With this plugin the player will always join the game at the default world spawn point

null 1 Jan 7, 2022
This is a plugin for pocketmine-mp, when locking a player's items helps players not to lose items or throw things around causing server lag.

[] LockedItem| v1.0.0 Player's item lock Features Player's item lock Players aren't afraid of losing items For Devolopers You can access to LockedItem

JeroGamingYT 3 Jan 4, 2022
A PocketMine-MP plugin to cancel the player's sprint

NoSprint A PocketMine-MP plugin to cancel the player's spint. Features Permissions bypass. Custom messages. Per world support. Lightweight and open so

null 3 May 17, 2022
A PocketMine-MP plugin to regulate player hunger and prohibit eating certain foods easily

NoEats A PocketMine-MP plugin to regulate player hunger and prohibit eating certain foods easily. Features Managing hunger. Permission bypass. Support

null 2 Jan 16, 2022
NoFly is a PocketMine-MP plugin that doesn't allow the player to fly

NoFly is a PocketMine-MP plugin that doesn't allow the player to fly

Azel F. 2 Mar 30, 2022