Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public ServerListPingScriptEventPaperImpl() {
ListedPlayersEditor.setListedPlayerInfo(evt.getEvent(), text);
return true;
});
this.<ServerListPingScriptEventPaperImpl, ElementTag>registerOptionalDetermination("player_count", ElementTag.class, (evt, context, input) -> {
if (!CoreConfiguration.allowRestrictedActions) {
Debug.echoError("Cannot use 'player_count' in list ping event: 'Allow restricted actions' is disabled in Denizen config.yml.");
return false;
}
if (input.isInt()) {
evt.getEvent().setNumPlayers(input.asInt());
return true;
}
return false;
});
}

public PaperServerListPingEvent getEvent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class ListPingScriptEvent extends BukkitScriptEvent implements Listener {
// "ICON:<ElementTag>" of a file path to an icon image, to change the icon that will display.
// "PROTOCOL_VERSION:<ElementTag(Number)>" to change the protocol ID number of the server's version (only on Paper).
// "VERSION_NAME:<ElementTag>" to change the server's version name (only on Paper).
// "EXCLUDE_PLAYERS:<ListTag(PlayerTag)>" to exclude a set of players from showing in the player count or preview of online players (only on Paper).
// "EXCLUDE_PLAYERS:<ListTag(PlayerTag)>" to exclude a set of players from showing in the preview of online players (only on Paper).
// "ALTERNATE_PLAYER_TEXT:<ListTag>" to set custom text for the player list section of the server status (only on Paper). (Requires "Allow restricted actions" in Denizen/config.yml). Usage of this to present lines that look like player names (but aren't) is forbidden.
// "PLAYER_COUNT:<ElementTag(Number)>" to set the amount of players that are online (only on Paper). (Requires "Allow restricted actions" in Denizen/config.yml). Usage of this to display a higher number of players than are actually connected is forbidden.
// "MOTD:<ElementTag>" to change the MOTD that will show.
//
// -->
Expand Down