diff --git a/paper/src/main/java/com/denizenscript/denizen/paper/events/ServerListPingScriptEventPaperImpl.java b/paper/src/main/java/com/denizenscript/denizen/paper/events/ServerListPingScriptEventPaperImpl.java index 6ea097a13d..577e2e2de3 100644 --- a/paper/src/main/java/com/denizenscript/denizen/paper/events/ServerListPingScriptEventPaperImpl.java +++ b/paper/src/main/java/com/denizenscript/denizen/paper/events/ServerListPingScriptEventPaperImpl.java @@ -70,6 +70,17 @@ public ServerListPingScriptEventPaperImpl() { ListedPlayersEditor.setListedPlayerInfo(evt.getEvent(), text); return true; }); + this.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() { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/server/ListPingScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/server/ListPingScriptEvent.java index 0e8e554d2c..f7da4ef31a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/server/ListPingScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/server/ListPingScriptEvent.java @@ -46,8 +46,9 @@ public class ListPingScriptEvent extends BukkitScriptEvent implements Listener { // "ICON:" of a file path to an icon image, to change the icon that will display. // "PROTOCOL_VERSION:" to change the protocol ID number of the server's version (only on Paper). // "VERSION_NAME:" to change the server's version name (only on Paper). - // "EXCLUDE_PLAYERS:" to exclude a set of players from showing in the player count or preview of online players (only on Paper). + // "EXCLUDE_PLAYERS:" to exclude a set of players from showing in the preview of online players (only on Paper). // "ALTERNATE_PLAYER_TEXT:" 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:" 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:" to change the MOTD that will show. // // -->