πŸ‘¨β€πŸ‘¨β€πŸ‘¦β€πŸ‘¦ CustomPlayerCount [v1.0]

CUSTOM PLAYER COUNT

Custom Player Count is a simple plugin allowing you to modify your server count with math functions.


:gift_heart: Donations

I love being able to code plugins on Sponge for you! But it takes a lot of time and effort. If you run a profitable server off one of my plugins, please feel free to share the love! :heart_decoration:
Donate Here


:package: FEATURES

  • Change server online count
  • Use math functions in the count
  • Include original count in the function

:file_folder: DOWNLOADS

All Releases: Download Here
Find the latest version that supports your API.


:wrench: COMMANDS

/customplayercount - Tells you the version of the plugin
/cpc - Tells you the version of the plugin

:hammer: PERMISSIONS

None

:warning: BUGS

If you find any bugs or would like to suggest features, please create an issue on GitHub

4 Likes
Comments on the plugin
  • You can @Inject a PluginContainer.
  • Commands should be registered in GameInitializationEvent; if a server doesn’t start (such as in singleplayer), or starts and stops multiple times, the commands will be repeatedly registered.
  • cause.first(Player.class).ifPresent(p -> p.sendMessage(/*etc*/))
  • Since you only have one config file, and a simple one at that, why not just set sharedRoot to true, and use the default config file?

Thank you for the coding tips. :smile:

sharedRoot is false just by personal preference of having a folder.

You can add a random value? For example, between max and min. Change Player Count through time?

Add one that will always show one more player then the current amount of players online?

This is possible by setting the player count in the config to
{online} + 1

I’ll add a variable for a random value between a max and min for the next update. Thanks for the suggestion! :slight_smile:

Edit:
It works! :slight_smile: (This is me refreshing the server list a couple times)

Update coming soon.

UPDATE v1.1


WARNING

If you’re updating from 1.0 you must delete your config file!
Auto config updates weren’t implemented yet!


FEATURES

  • Added {randInt} variable

[12:10:47] [Server thread/WARN] [Sponge]: Plugin 'cpc' seems to be missing a valid mcmod.info metadata file. This is not a problem when testing plugins, however it is re
commended to include one in public plugins.
Please see https://docs.spongepowered.org/master/en/plugin/plugin-meta.html for details.

forge-1.11-13.19.0.2178-universal.jar
spongeforge-1.11-2178-6.0.0-BETA-1997.jar
latest plugin version

Recoding this plugin soon.
I realize now it’s very messy, and the next update will also implement the PlaceholderAPI.

@rojo8399 any news on your update? seems inactive at this point.