Chapter 1

Topper

The documentation for Topper - The leaderboard plugin/mod.

Where to find the plugin:

Subsections of Topper

Quick Start

This will quickly introduce you to the basics of the plugin, by creating a simple leaderboard.

Add a Top Holder

The unit that stores and manages the leaderboard data is called a Top Holder. Inside the Top Holder, you can define a Value Provider, which is responsible for providing the value of each entry in the leaderboard.

We will start by creating a Top Holder named jump and defining a Value Provider to count the number of times the player jumps. The Value Provider we will use is called Statistic Provider.

Open the config.yml file from the plugin’s folder (plugins/Topper/config.yml), head to the holders section, and add the following configuration:

holders:
  jump: # The name of the Top Holder
    type: statistic # The type of the Value Provider, which in this case is a Statistic Provider
    statistic: jump # The name of the statistic that will be used to count the number of jumps

Open the config.json file from the mod’s folder (config/topper/config.json), head to the holders section, and add the following configuration:

{
  "holders": {
    "jump": { // The name of the Top Holder
      "type": "statistic", // The type of the Value Provider, which in this case is a Statistic Provider
      "statistic": "minecraft:jump" // The name of the statistic that will be used to count the number of jumps
    }
  }
}

That is all you need to do, now the plugin is ready to start counting the number of jumps.

Open your server terminal and type /reloadtop to apply the changes.

Display the Top Holder

There are several ways to display the leaderboard of a Top Holder. In this case, we will simply display the top 10 players in the chat.

To do this, type the following command:

/gettop jump 10

gettop gettop

Add another Top Holder

Now, let’s add another Top Holder to show the amount of diamond ores a player has mined.

Open the config.yml file from the plugin’s folder (plugins/Topper/config.yml), head to the holders section, and add the following configuration:

holders:
  jump:
    type: statistic
    statistic: jump
  mine:
    type: statistic
    statistic: mine_block
    material: diamond_ore

mine_block needs a block material to work. Hence, we added the material field to specify the block material, which in this case is diamond_ore.

Open the config.json file from the mod’s folder (config/topper/config.json), head to the holders section, and add the following configuration:

{
  "holders": {
    "jump": {
      "type": "statistic",
      "statistic": "minecraft:jump"
    },
    "mine": { // The name of the Top Holder
      "type": "statistic", // The type of the Top Holder
      "statistic-type": "minecraft:mined", // The type of the statistic
      "statistic": "minecraft:diamond_ore" // The name of the statistic
    }
  }
}

Open your server terminal and type /reloadtop to apply the changes.

Now, you can display the top 10 players who have mined the most diamond ores by typing the following command:

/gettop mine 10

gettop gettop

What’s next?

This is just the beginning. You can check the other pages in the documentation to learn more about the plugin and its features. There could be something that you might find interesting for your server.

Happy building! 🚀

Commands & Permissions

CommandPermissionDescription
gettop <holder>topper.topGet the top 10 players of a leaderboard provided by the specified <holder>
gettop <holder> <number>topper.topGet the top <number> players of a leaderboard provided by the specified <holder>
gettop <holder> <from_index> <to_index>topper.topGet the players from the specified index range of a leaderboard provided by the specified <holder>
reloadtoptopper.reloadReload the plugin

Config

# The type of storage the plugin will use to store the value
# Available: FLAT, YAML, JSON, SQLITE, NEW-SQLITE, MYSQL
storage-type: yaml

# The settings for the Top Holders
holders: {}

# Should the plugin load all offline players when the server starts
load-all-offline-players: false
task:
  save:
    # How many entries should be saved per tick
    entry-per-tick: 10
    # How many ticks should the plugin wait before saving the leaderboard
    delay: 0
  update:
    # How many entries should be updated per tick
    entry-per-tick: 10
    # How many ticks should the plugin wait before updating the leaderboard
    delay: 0
    # How many times should the plugin skip updating the value for the entry if it fails to update
    # This is useful to let the plugin prioritize other active entries
    max-skips: 1
    # How many ticks should the plugin wait before applying the updated value to the entry
    # Since the holder is updated partially, this is useful to prevent the plugin from applying the value too early
    # and to allow the plugin to apply the value in larger batches, creating the illusion of a single update
    set-delay: 20
{
  // The type of storage the plugin will use to store the value
  // Available: FLAT, SQLITE, MYSQL
  "storage-type": "flat",

  // The settings for the Top Holders
  "holders": {},

  "task": {
    "save": {
      // How many entries should be saved per tick
      "entry-per-tick": 10,
      // How many ticks should the plugin wait before saving the leaderboard
      "delay": 0
    },
    "update": {
      // How many entries should be updated per tick
      "entry-per-tick": 10,
      // How many ticks should the plugin wait before updating the leaderboard
      "delay": 0,
      // How many times should the plugin skip updating the value for the entry if it fails to update
      // This is useful to let the plugin prioritize other active entries
      "max-skips": 1,
      // How many ticks should the plugin wait before applying the updated value to the entry
      // Since the holder is updated partially, this is useful to prevent the plugin from applying the value too early
      // and to allow the plugin to apply the value in larger batches, creating the illusion of a single update
      "set-delay": 20
    }
  }
}

Frequently Asked Questions

I set my Value Provider, but it’s laggy

In most cases, you’d better enable async (Tutorial) so that your provider is run on an asynchronous thread that doesn’t affect your main server thread. However, some providers may not support asynchronous run and require to run on the main thread. In that case, either you have to find one that supports and test it or ask the author of that provider to add support for that.

Some providers may have an online option that determines whether the provider should only be run for online players (like PlaceholderAPI). If so, you are recommended to enable it to avoid unnecessary computations for offline players.

For those who are using statistic placeholder in the PlaceholderAPI Value Provider, you are recommended to either enable online option or check out the built-in Statistic Provider.

My name isn’t appearing in the Top Holder after I set it up

As Topper only registers players when they join the server, the issue can be solved by just re-joining the server.

The Top Holder doesn’t work

In most cases, there must be a reason why the holder is not working. Here are some common practices we gather from similar cases:

  • Check if the configuration is properly set up: There are cases when there is a syntax error in the configuration file or the configuration is not formatted correctly. You should check the file with some validation tools such as YAML Lint.
  • Check if the required settings are properly set up: Make sure to check your settings against the wiki. There are cases when users mixed up the settings or forgot to set some required settings, so please read the wiki carefully.
  • Check if there is any errors: Make sure to check your logs for any errors related to your Top Holder. If there isn’t one, make sure to enable show-errors in the configuration (Tutorial).

After all, there must be a reason why the holder is not working. Please check thoroughly and provide more details about the issue when you report it in the support channel.

I set my PlaceholderAPI’s placeholder but it is not showing the value in the Top Holder

  • Make sure that the placeholder you are using is valid and that the plugin that provides the placeholder is installed and working correctly.
  • Try running the command /papi parse me <placeholder> to see if the placeholder is working as expected.
  • Check if the placeholder is for online players only. If so, set the online option to true in the configuration.
  • Try setting show-errors to true to see if there are any errors when parsing the placeholder. (Tutorial)
  • If the placeholder is still not working, ask for help in the plugin’s support channel or forum (remember to enable show-errors (Tutorial) and provide the logs to them for better support).

My placeholder gives a formatted value (e.g., 1,000.00 instead of 1000). Can I use it in the provider?

No, the placeholder provider only supports numerical values (only numbers and decimal separator . (dot) ). You must use a placeholder that returns a raw number without formatting, if possible. If the plugin that provides the placeholder does not have an option to return a raw number, you can try using a different placeholder or ask the plugin developer to add support for raw numbers.

If the value is a simple formatted number, you can try Handling the Formatted Value.

How can I know if a placeholder works with Topper?

Here is a rough list of criteria that a placeholder should have in order to work with Topper:

  • The placeholder should only returns raw number
    • That means it should only have digits and one . (dot) as a decimal separator
      • Work: 100, 100.00, 100.123
      • Won’t work: abc, 1,000,000, 100,000.122, 100.000.000, 1 000 000
  • The placeholder should work with both online and offline players
  • If the placeholder doesn’t work with offline players, it should return an empty string or the placeholder itself
  • If there is any error in the logic of the placeholder, it should return an empty string or the placeholder itself

I want to format the value returned by my placeholder in my leaderboard

First, you should ALWAYS use a placeholder that returns a raw number without formatting, if possible (Check the previous questions for more information).

Then in your query to get the value from the Top Holder, you can apply [Value Display]({{ ref “topper/extra/value_display” }}) to format the value.

In short, use the placeholder that returns a raw number when setting up the Top Holder, then apply Value Display settings when setting up the display of the leaderboard.

I want to shorten the number (e.g. 1000000 to 1M)

The [Value Display function]({{ ref “topper/extra/value_display” }}) can be used to shorten the number. For example, money:value:shorten will shorten the number of the value in the money Top Holder.

I am so confused about how to use Topper

Take a deep breath and read the wiki again. You should take it slow and read the wiki carefully as you can miss some important details if you read it too quickly. If you still have trouble, feel free to ask for help in the Discord server. Remember to provide a clear and concise description of your issue, including any relevant error messages or screenshots.

Chapter 5

Value Provider

A unit that provides values to the Top Holder. Continue reading to learn more about the built-in value providers.

Subsections of Value Provider

Statistic

This is a provider that provides statistic values of a player to the Top Holder.

Format

holders:
  <holder-name>:
    # The type of the provider
    type: statistic
    # The name of the statistic
    statistic: <statistic>
    # The name of the material. Used for some statistics that require an item.
    material: <material>
    # The name of the entity. Used for some statistics that require an entity.
    entity: <entity>
  • Available values for <statistic> can be found here
  • Available values for <material> can be found here
  • Available values for <entity> can be found here
{
  "holders": {
    "<holder-name>": {
      // The type of the provider
      "type": "statistic",
      // The type of the statistic
      "statistic-type": "<statistic-type>",
      // The name of the statistic
      "statistic": "<statistic>"
    }
  }
}
  • The available <statistic-type> and <statistic> can be found here

Behavior

  • If the statistic is a Generic type, the material and entity fields are ignored. The provider will return the value of the statistic for the player.

  • If the statistic is a Material type, the material field will be used:

    • If the material is not specified, the provider will return the value of the statistic for all materials.
    • If the material is specified, the provider will return the value of the statistic for the specified material.
    • The material field can be a string or a list of strings.
material: STONE

material:
  - STONE
  - COBBLESTONE
  • If the statistic is an Entity type, the entity field will be used:
    • If the entity is not specified, the provider will return the value of the statistic for all entities.
    • If the entity is specified, the provider will return the value of the statistic for the specified entity.
    • The entity field can be a string or a list of strings.
entity: ZOMBIE

entity:
  - ZOMBIE
  - SKELETON
  • If the statistic-type is not specified, it will default to minecraft:custom.
  • If the statistic-type is minecraft:custom, the value of the statistic field will be one of the Custom statistic names
  • If the statistic-type is one of the ITEM types (e.g. minecraft:broken, minecraft:crafted, minecraft:used, minecraft:picked_up, etc.), the value of the statistic field will be one of the Items
  • If the statistic-type is one of the ENTITY types (e.g. minecraft:killed, minecraft:killed_by, etc.), the value of the statistic field will be one of the Entities
  • If the statistic-type is one of the BLOCK types (e.g. minecraft:mined, minecraft:broken, etc.), the value of the statistic field will be one of the Blocks

Example

holders:
  # Holder that shows the number of times a player has jumped
  jump:
    type: statistic
    statistic: JUMP
  # Holder that shows the number of blocks mined by a player
  mine:
    type: statistic
    statistic: MINE_BLOCK
  # Holder that shows the number of times a player has killed a zombie
  zombie:
    type: statistic
    statistic: KILL_ENTITY
    entity: ZOMBIE
  # Holder that shows the number of times a player has mined diamond ore
  diamond:
    type: statistic
    statistic: MINE_BLOCK
    material: DIAMOND_ORE
  # Holder that shows the number of times a player has mined diamond ore or gold ore
  diamond_or_gold:
    type: statistic
    statistic: MINE_BLOCK
    material:
      - DIAMOND_ORE
      - GOLD_ORE
  # Holder that shows the number of times a player has killed a zombie or a skeleton
  zombie_or_skeleton:
    type: statistic
    statistic: KILL_ENTITY
    entity:
      - ZOMBIE
      - SKELETON
{
  "holders": {
    // Holder that shows the number of times a player has jumped
    "jump": {
      "type": "statistic",
      "statistic": "minecraft:jump"
    },
    // Holder that shows the number of times a player has mined a block
    "mine": {
      "type": "statistic",
      "statistic-type": "minecraft:mined"
    },
    // Holder that shows the number of times a player has killed a zombie
    "zombie": {
      "type": "statistic",
      "statistic-type": "minecraft:killed",
      "statistic": "minecraft:zombie"
    },
    // Holder that shows the number of times a player has mined diamond ore
    "diamond": {
      "type": "statistic",
      "statistic-type": "minecraft:mined",
      "statistic": "minecraft:diamond_ore"
    },
    // Holder that shows the number of times a player has mined diamond ore or gold ore
    "diamond_or_gold": {
      "type": "statistic",
      "statistic-type": "minecraft:mined",
      "statistic": [
        "minecraft:diamond_ore",
        "minecraft:gold_ore"
      ]
    },
    // Holder that shows the number of times a player has killed a zombie or a skeleton
    "zombie_or_skeleton": {
      "type": "statistic",
      "statistic-type": "minecraft:killed",
      "statistic": [
        "minecraft:zombie",
        "minecraft:skeleton"
      ]
    }
  }
}

Placeholder

This is a provider that allows you to use PlaceholderAPI placeholders as values in the Top Holder.

Format

Note
holders:
  <holder-name>:
    # The type of the provider
    type: placeholder
    # The placeholder used to get the value
    placeholder: <placeholder>
    # Whether the placeholder should be parsed for online players only (Those who are in the server). Default is true.
    # If set to false, the placeholder will be parsed for all players, even those who are offline.
    online: <true/false>
Note

The placeholders are provided by Text Placeholder API You can check its wiki for more information: Wiki

{
  "holders": {
    "<holder-name>": {
      // The type of the provider
      "type": "placeholder",
      // The placeholder used to get the value
      "placeholder": "<placeholder>"
    }
  }
}

Example

holders:
  # Holder that shows the number of diamonds a player has mined
  # Use the Statistic expansion: /papi ecloud download Statistic
  diamonds:
    type: placeholder
    placeholder: "%statistic_mine_block:DIAMOND_ORE%"
  # Holder that shows the amount of money a player has
  # Use the Vault expansion: /papi ecloud download Vault
  money:
    type: placeholder
    placeholder: "%vault_eco_balance%"
    online: false # Get the value for all players, even those who are offline.
{
  "holders": {
    // Holder that shows the level of a player
    // Use PlayerEx
    "level": {
      "type": "placeholder",
      "placeholder": "%playerex:level%"
    }
  }
}

MiniPlaceholder

Note

This is a provider that allows you to use MiniPlaceholders placeholders as values in the Top Holder.

Format

holders:
  <holder-name>:
    # The type of the provider
    type: mini-placeholder
    # The placeholder used to get the value
    placeholder: <placeholder>
{
  "holders": {
    "<holder-name>": {
      // The type of the provider
      "type": "mini-placeholder",
      // The placeholder used to get the value
      "placeholder": "<placeholder>"
    }
  }
}

Example

holders:
  # Holder that shows the amount of money a player has
  # Use the Vault expansion: https://modrinth.com/plugin/miniplaceholders-vault-expansion
  money:
    type: mini-placeholder
    placeholder: "<vault_eco_balance>"
{
  "holders": {
    "money": {
      "type": "mini-placeholder",
      "placeholder": "<vault_eco_balance>"
    }
  }
}

Query

This page provides information about the query system, which is used to retrieve data from the Top Holder.

Format

The format of a query is as follows:

<holder>;<type>;<args>
  • <holder>: The Top Holder to query.
  • <type>: The type of data to retrieve.
  • <args>: Additional arguments for the query.

If the <type> does not require any arguments, the query can be simplified to:

<holder>;<type>

Types

TypeArgumentDescriptionExampleExplanation
top_name<position>The name of the player at the specified position.money;top_name;1Retrieve the name of the player at the first position in the Top Holder named money
top_key<position>The UUID of the player at the specified position.money;top_key;1Retrieve the UUID of the player at the first position in the Top Holder named money
top_value<position>The value of the player at the specified position.money;top_value;1Retrieve the value of the player at the first position in the Top Holder named money
top_value<position>;<format>The formatted value of the player at the specified position.money;top_value;1;#,###Retrieve the formatted value of the player at the first position in the Top Holder named money
top_value_raw<position>The raw value of the player at the specified position.money;top_value_raw;1Retrieve the raw value of the player at the first position in the Top Holder named money
top_rankThe rank of the player.money;top_rankRetrieve the rank of the player in the Top Holder named money
top_rank<format>The formatted rank of the player.money;top_rank;#,###Retrieve the formatted rank of the player in the Top Holder named money
top_sizeThe amount of entries in the Top Holder.money;top_sizeRetrieve the amount of entries in the Top Holder named money
valueThe value of the player.money;valueRetrieve the value of the player in the Top Holder named money
value<format>The formatted value of the player.money;value;#,###Retrieve the formatted value of the player in the Top Holder named money
value_rawThe raw value of the player.money;value_rawRetrieve the raw value of the player in the Top Holder named money
Chapter 7

Hook

Details about the hooks provided by the plugin.

Subsections of Hook

MiniPlaceholders

Note

The plugin provides a MiniPlaceholders placeholder to allow you to query data from the Top Holder.

Usage

<topper_global:<query>>
<topper_player:<query>>

Check the Query section for more information about how to set the <query>.

Example

<topper_global:money;top_name;1>
<topper_global:money;top_value;1>
<topper_global:money;top_value;1;#,###>
<topper_player:money;top_rank>

PlaceholderAPI

The plugin provides a PlaceholderAPI placeholder to allow you to query data from the Top Holder.

Usage

Note
%topper_<query>%
Note

The placeholders are provided by Text Placeholder API It’s bundled in the mod, you don’t need to install it separately.

%topper:query <query>%

Check the Query section for more information about how to set the <query>.

Example

%topper_money;top_name;1%
%topper_money;top_value;1%
%topper_money;top_value;1;#,###%
%topper_money;top_rank%

%topper:query money;top_name;1% %topper:query money;top_value;1% %topper:query money;top_value;1;#,###% %topper:query money;top_rank%

Chapter 8

Extra

Extra tutorials for common features and tasks.

Note

Parts of the tutorials in this section assume that you’ve done the Quick Start. If there is anything you don’t understand from the tutorials, you may want to go back and do the Quick Start.

Subsections of Extra

Create a Hologram

Note

Requires PlaceholderAPI and a hologram plugin that supports PlaceholderAPI such as DecentHolograms

You can use the top_name and top_value placeholders to display players in the leaderboard.

Here is an example of a hologram that displays the top 5 players in the leaderboard:

&b&lJUMP LEADERBOARD
&7#1 &f%topper_jump;top_name;1% &7- &b%topper_jump;top_value;1%
&7#2 &f%topper_jump;top_name;2% &7- &b%topper_jump;top_value;2%
&7#3 &f%topper_jump;top_name;3% &7- &b%topper_jump;top_value;3%
&7#4 &f%topper_jump;top_name;4% &7- &b%topper_jump;top_value;4%
&7#5 &f%topper_jump;top_name;5% &7- &b%topper_jump;top_value;5%

hologram hologram

Note

If you don’t know what top_name and top_value are, you can find more information about them in the Query section

Create a Top Block

Note

Create a Top Skull

  1. Prepare a skull template named jump_skull that returns the UUID of the player at the specific {index} of the jump leaderboard
/varblocks template add jump_skull %topper_jump;top_key;{index}%
  1. Place the skull skull1 skull1

  2. While looking at the skull, run the following command to assign the jump_skull template to the skull

/varblocks block add jump_1 skull jump_skull
  1. Set the {index} of the skull to 1 to display the top player
/varblocks block argument jump_1 index 1
  1. Create another skull for the second player
/varblocks block add jump_2 skull jump_skull
/varblocks block argument jump_2 index 2

skull2 skull2

Create a Top Sign

  1. Prepare a sign template named jump_sign that displays the player’s name and value at the specific {index} of the jump leaderboard
/varblocks template add jump_sign
/varblocks template add jump_sign &6#{index}&7: &f%topper_jump;top_name;{index}%
/varblocks template add jump_sign &e%topper_jump;top_value;{index}%
/varblocks template add jump_sign
  1. Place the sign sign1 sign1

  2. While looking at the sign, run the following command to assign the jump_sign template to the sign

/varblocks block add jump_sign_1 sign jump_sign
  1. Set the {index} of the sign to 1 to display the top player
/varblocks block argument jump_sign_1 index 1
  1. Create another sign for the second player
/varblocks block add jump_sign_2 sign jump_sign
/varblocks block argument jump_sign_2 index 2

sign2 sign2

Create an NPC

Note
  1. Create a player NPC
/npc create %topper_jump;top_name;1%
  1. Set the skin of the NPC
/npc skin %topper_jump;top_name;1%

The NPC will display the skin of the top player of the jump leaderboard.

Customize Value Provider

Asynchronous Provider

You can set async to true to make the provider asynchronous, meaning it will be executed in a separate thread. This can be useful if the provider is slow or if it performs a lot of calculations.

holders:
  jump:
    <your other settings>
    async: true
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "async": true
    }
  }
}

Default Values

You can change the default values, returned by some queries and commands, by adding some settings to your holder settings.

holders:
  jump:
    <your other settings>
    default-value: null # The default value of an entry. This will be used when a player joins the server the first time
    null-name: "---" # Default value for the name
    null-uuid: "---" # Default value for the uuid
    null-value: "---" # Default value for the value
    line: "&7[&b{index}&7] &b{name} &7- &b{value}" # Default format for the top line in the top list
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "default-value": null,
      "null-name": "---",
      "null-uuid": "---",
      "null-value": "---",
      "line": "<gray>[<blue>{index}<gray>] <blue>{name} <gray>- <blue>{value}"
    }
  }
}

Reversed Leaderboard

By default, the leaderboard is measured by the player with the highest value first. If you want to change that (e.g. show the player with the least value first), you can set reverse to true.

holders:
  jump:
    <your other settings>
    reverse: true
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "reverse": true
    }
  }
}

Handle Formatted Values

If the output of a Value Provider (Placeholder for example) is a formatted value and you are confident that you can get the raw value from it with a simple method of taking only numbers and the decimal separator, you can enable the formatted option in your Holder Setting.

holders:
  example-formatted-value-provider:
    <your other settings>
    formatted: true
    formatted-settings: # Optional settings for the formatted value
      decimal-separator: "." # Change this to the decimal separator of the formatted value
{
  "holders": {
    "example-formatted-value-provider": {
      "<your other settings>": "you other settings",
      "formatted": true,
      "formatted-settings": { // Optional settings for the formatted value
        "decimal-separator": "." // Change this to the decimal separator of the formatted value
      }
    }
  }
}

Ignore & Reset Permission

You can specify a set of permissions so that the Holder will skip updating the value of the player if they have one of the permissions.

holders:
  jump:
    <your other settings>
    ignore-permission: exclude.permission

  jump-multiple:
    <your other settings>
    ignore-permission:
      - exclude.permission1
      - exclude.permission2
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "ignore-permission": "exclude.permission"
    },
    "jump-multiple": {
      "<your other settings>": "you other settings",
      "ignore-permission": [
        "exclude.permission1",
        "exclude.permission2"
      ]
    }
  }
}

You can also specify a set of permissions so that the Holder will reset the value of the player if they have one of the permissions.

holders:
  jump:
    <your other settings>
    reset-permission: reset.permission

  jump-multiple:
    <your other settings>
    reset-permission:
      - reset.permission1
      - reset.permission2
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "reset-permission": "reset.permission"
    },
    "jump-multiple": {
      "<your other settings>": "you other settings",
      "reset-permission": [
        "reset.permission1",
        "reset.permission2"
      ]
    }
  }
}

Show Errors

By default, any errors that occur during the execution of a provider will be truncated. If you want to show the errors instead, you can set show-errors to true.

holders:
  jump:
    <your other settings>
    show-errors: true
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "show-errors": true
    }
  }
}

You can also reset the value of the player if there is an error when updating the value.

holders:
  jump:
    <your other settings>
    reset-on-error: true
{
  "holders": {
    "jump": {
      "<your other settings>": "you other settings",
      "reset-on-error": true
    }
  }
}

Migrate from 2.X

  1. Download and install Topper 3.0.0 here
  2. Install VarBlocks if you use Top Signs or Top Skulls here
  3. Run the server and let Topper convert your data
  4. You’re done! Enjoy the new features of Topper 3.0.0!

Playtime Leaderboard

This will guide you on how to create an unreliable playtime leaderboard for your server using the built-in Statistic Value Provider and format the value using Value Display.

Add the Holder

Open the config.yml file and add the following holder:

holders:
  playtime:
    type: statistic
    statistic: PLAY_ONE_MINUTE # Or PLAY_ONE_TICK if your server is running on 1.12 or below

Open the config.json file and add the following holder:

{
  "holders": {
    "playtime": {
      "type": "statistic",
      "statistic": "minecraft:play_time"
    }
  }
}

This will create a holder named playtime that shows the total playtime of a player in ticks.

But the value is in ticks, which is not human-readable. So, we need to format it. Add the following line:

holders:
  playtime:
    type: statistic
    statistic: PLAY_ONE_MINUTE
    line: "&7[&b{index}&7] &b{name} &7- &b{value_time:pattern=HH:mm:ss&type=duration&unit=ticks}"
{
  "holders": {
      "playtime": {
          "type": "statistic",
          "statistic": "minecraft:play_time",
          "line": "<gray>[<blue>{index}<gray>] <blue>{name} <gray>- <blue>{value_time:pattern=HH:mm:ss&type=duration&unit=ticks}"
      }
  }
}

We added the line setting to the holder and override the default line. The {value_time:pattern=HH:mm:ss&type=duration&unit=ticks} will format the value to a human-readable time format.

Now when you save and restart the server, you should see the playtime leaderboard in the /gettop playtime command.

Command output Command output

Display the Leaderboard

We will display it in a hologram

Here is an example of a hologram that displays the top 5 players in the leaderboard:

&b&lPLAYTIME LEADERBOARD
&7#1 &f%topper_playtime;top_name;1% &7- &b%topper_playtime;top_value;1;time:pattern=HH:mm:ss&type=duration&unit=ticks%
&7#2 &f%topper_playtime;top_name;2% &7- &b%topper_playtime;top_value;2;time:pattern=HH:mm:ss&type=duration&unit=ticks%
&7#3 &f%topper_playtime;top_name;3% &7- &b%topper_playtime;top_value;3;time:pattern=HH:mm:ss&type=duration&unit=ticks%
&7#4 &f%topper_playtime;top_name;4% &7- &b%topper_playtime;top_value;4;time:pattern=HH:mm:ss&type=duration&unit=ticks%
&7#5 &f%topper_playtime;top_name;5% &7- &b%topper_playtime;top_value;5;time:pattern=HH:mm:ss&type=duration&unit=ticks%

hologram hologram

Value Display

Some places like {value} in line and the value and top_value queries can be expanded to format the value in a more readable way. This is done by specifying some settings for them like:

  • {value_<format>}
  • <holder>;value;<format>
  • <holder>;top_value;<position>;<format>

The following section will guide you through the available formats to replace <format>, we will use the <holder>;value;<format> query as an example.

Available Formats

Decimal Format

Format: decimal:setting1=value1&setting2=value2

SettingDescriptionDefaultExample
decimalSeparatorThe character used to separate the integer part from the fractional part.decimalSeparator=.
groupingSeparatorThe character used to separate groups of digits to the left of the decimal separatorgroupingSeparator=,
groupingSizeThe number of digits in each group to the left of the decimal separatorgroupingSize=3
maximumFractionDigitsThe maximum number of digits allowed in the fractional part of the numbermaximumFractionDigits=2

Example: jump;value;decimal:decimalSeparator=,&groupingSeparator=.&groupingSize=3&maximumFractionDigits=2

Time Format

Format: time:setting1=value1&setting2=value2

SettingDescriptionDefaultExample
patternThe pattern describing the date and time format. There are short forms to pattern (see Short Form)HH:mm:sspattern=HH:mm:ss
typeThe type of the time: duration or timedurationtype=duration
unitThe unit of the time: ticks, nanoseconds, microseconds, milliseconds, seconds, minutes, hours, dayssecondsunit=seconds

Example: playtime;value;time:pattern=HH:mm:ss&type=duration&unit=ticks

Short Form

There are some short forms to the pattern for conveniently defining the format without remembering too much of the syntax.

Depending on the type of the time, there are different short forms. Here is a list of the different short forms based on the type:

  • type=duration
    • pattern=default: Use the format HH:mm:ss
    • pattern=word: Use a format that describes the duration in words (e.g. 1 day 1 hour 2 minutes 30 seconds)
    • pattern=short: Use the format H:mm:ss
    • pattern=short-word: Use the format d'd 'H'h 'm'm 's's' (e.g. 1d 1h 2m 30s)
  • type=time
    • The available short forms of the pattern can be found in the Predefined Formatters of the DateTimeFormatter
    • For example, if you want to use ISO_LOCAL_DATE, the setting will be pattern=ISO_LOCAL_DATE

Shorten

Format: shorten

This is a format that shorten the number to the nearest “number group” (e.g. 1000 will be 1k)

The default behavior will support the following groups:

  • 1,000 to 1k
  • 1,000,000 to 1M
  • 1,000,000,000 to 1B
  • 1,000,000,000,000 to 1T

You can also define a list of custom groups by specifying them as settings in pair of number and suffix. For example: shorten:1000=k&100000=hk&1000000=m would shorten the number based on the following groups:

  • 1,000 to 1k
  • 100,000 to 1hk
  • 1,000,000 to 1m

Example:

  • money:value:shorten
  • money:value:shorten:1000=k&100000=hk&1000000=m