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.
Extra tutorials for common features and tasks.
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.
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>
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
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%
Requires PlaceholderAPI and VarBlocks
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}%
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
{index}
of the skull to 1 to display the top player/varblocks block argument jump_1 index 1
/varblocks block add jump_2 skull jump_skull
/varblocks block argument jump_2 index 2
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
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
{index}
of the sign to 1 to display the top player/varblocks block argument jump_sign_1 index 1
/varblocks block add jump_sign_2 sign jump_sign
/varblocks block argument jump_sign_2 index 2
Requires PlaceholderAPI and Citizens
/npc create %topper_jump;top_name;1%
/npc skin %topper_jump;top_name;1%
The NPC will display the skin of the top player of the jump
leaderboard.
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
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
In some Value Providers like Placeholder, you may need to ensure that it would take the value of online players only (For example, by setting online
to true
in Placeholder Value Provider)
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
.
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
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}"
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.
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%
By default, the top 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
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.
Format:
decimal:setting1=value1&setting2=value2
Setting | Description | Default | Example |
---|---|---|---|
decimalSeparator | The character used to separate the integer part from the fractional part | . | decimalSeparator=. |
groupingSeparator | The character used to separate groups of digits to the left of the decimal separator | groupingSeparator=, | |
groupingSize | The number of digits in each group to the left of the decimal separator | groupingSize=3 | |
maximumFractionDigits | The maximum number of digits allowed in the fractional part of the number | maximumFractionDigits=2 |
Example: jump;value;decimal:decimalSeparator=,&groupingSeparator=.&groupingSize=3&maximumFractionDigits=2
Format:
time:setting1=value1&setting2=value2
Setting | Description | Default | Example |
---|---|---|---|
pattern | The pattern describing the date and time format | HH:mm:ss | pattern=HH:mm:ss |
type | The type of the time: duration or time | duration | type=duration |
unit | The unit of the time: ticks , nanoseconds , microseconds , milliseconds , seconds , minutes , hours , days | seconds | unit=seconds |
Example: playtime;value;time:pattern=HH:mm:ss&type=duration&unit=ticks