Skip to content

U-Blocks/UStatistic

Repository files navigation

UStatistic UStatistic

Total Git clones GitHub Downloads (all assets, all releases) GitHub License


✨ Introductions

  • 9 types of statistical indicators
  • Free of tedious file editing
  • Support with full GUI forms
  • Support with hot reloading
  • Support with localized multi-language

📦 Installation

Check your Endstone's version
  • Endstone 0.10.0+
    • 251220
Check your pre-plugins
  • Optional pre-plugin
  1. Ensure you have downloaded the correct version and installed all required pre-plugins
  2. Place the .whl file into your server's plugins folder
  3. Restart your server
  4. Enter the command /ubd to call out the main form of UStatistic

📄 File structure

plugins/
├─ ustatistic/
│  ├─ statistical_data.json
│  ├─ lang/
│  │  ├─ zh_CN.json
│  │  ├─ en_US.json

⚙️ Configuration

statistical_data.json

{
    "umaru rize": {
        "break_count": 0,
        "place_count": 0,
        "death_count": 0,
        "kill_player_count": 0,
        "kill_mob_count": 0,
        "online_time": 0,
        "pick_up_item_count": 0,
        "drop_item_count": 0,
        "move_distance": 0
    }
}

🌎 Localized multi-language

  • Currently supported localized languages for UStatistic:
  • zh_CN
  • en_US
  • How to add more languages to UStatistic? Here we use Japanese for an example.
    • Create a file named ja_JP.json and place it into lang folder
    • Copy all key-value pairs from en_US.json and paste them into ja_JP.json
    • Refer to the English values and translate them all into Japanese, then save the file.
    • Restart your server, and you're all done!
  • If you'd like your translated language to be included as one of the official languages of this plugin, feel free to shoot over a PR.

💪API

"""
Read only

Ustatistic provides two types of API.

For type A, you can get the data of all players for the specified statistical indicators,
and it returns a dict.

For type B, you can get the data of a specified player for a specified statistical indicator,
and it returns an int.
"""

# Type A
self.server.plugin_manager.get_plugin("ustatistic").api_get_statistical_data(statistical_type: str) -> dict

# Type B
self.server.plugin_manager.get_plugin("ustatistic").api_get_player_statistical_data(statistical_type: str, player_name: str) -> int

"""
What is statistical type?

Statistical type is used to specify a statistical indicator, you can select one of the following values for input.
- break_count
- place_count
- death_count
- kill_mob_count
- kill_player_count
- drop_item_count
- pick_up_item_count
- move_distance
- online_time
"""

💡 Plugins