This plugin is no longer in development.
This plugin was requested by @adamwbb
This is my most popular plugin so far
How to use
Once you've loaded the plugin at least once, open up the config. In there you can edit whether permissions are used, the commands to run on daily join and hour of play and the delay between online-time rewards. To check your total playtime, do /playtime or /myplay.
Note: hour of play is total play time, not current session length
Permissions (must be enabled in config!)
- playtimerewards.dailyJoinReward - Allows the player to receive the daily join reward (given by default, unless you use PEX as it ignores defaults)
- playtimerewards.hourOfPlayReward - Allows the player to receive the hour of play reward (also given by default, unless you use PEX as it ignores defaults)
- playtimerewards.checkPlaytime - Allows the player to check their total playtime with /playtime or /myplay (also given by default, unless you use PEX as it ignores defaults)
- Download the plugin
- Place playtimerewards VX.X.X.jar in your plugin folder
- Restart/reload your server or use a plugin loader to enable playtimerewards
- Configure the config to do what you want it to.
- Restart/reload your server or use a plugin loader to reload playtimerewards
Video Tutorial by NumeroUno (Slightly Outdated)
Known Bugs (report in discussion) (not updated very often)
- Add a command to edit all config options in game (possibly)
- Non-UUID option for older versions (possibly)
- Add support for checking the playtime of others with /playtime
- A command you can add that messages the player without [CONSOLE -> me]
- Add a broadcast command to use without the [Server] prefix
- Bungee-cord support
- Delay before daily rewards
- A few crashes I'll look into soon
If youconfigVersion: 1 ||| DO NOT to change this||
hourOfPlayDelayMinutes: 60 ||| The amount of time IN MINUTES it takes to get given the playtime reward ||
usePermissions: false |||Whether players require permission to receive the rewards ||
randomDailyJoinCommandsToRun: 1 |||How many of the random reward commands to run when the player joins for the first time that day
randomHourOfPlayCommandsToRun: 1 |||Same as previous but for the playtime reward ||
dailyJoinCommand: |||The reward commands to be run when a player logs in for the first time in a day ||
- 'tell %player% &dHi!'- 'say &b%player%&a has joined for the first time today!'- 'say add as many more commands as you want in this bit!'
randomDailyJoinCommand: |||The random commands to choose from||
- 'tell %player% &aRandom 1'- 'tell %player% &bRandom 2'- 'say add as many more commands here as you want!'- 'say set it to run a custom amount of theese with the randomDailyJoinCommandsToRun variable!'
hourOfPlayCommand: |||Same as dailyJoinCommand but for the playtime reward||
- 'tell %player% &dHi!'- 'say &b%player%&a has just reached another hour of total play time!'- 'say You may want to edit the command above this if you edit the delay!'- 'say add as many more commands as you want in this bit!'
randomHourOfPlayCommand: |||Same as randomDailyJoinCommand but for the playtime reward||
- 'tell %player% &aRandom 1'- 'tell %player% &bRandom 2'- 'say add as many more commands here as you want!'- 'say set it to run a custom amount of theese with the randomHourOfPlayCommandsToRun variable!'
How to use the API (ptr 2.2.0+)
To use the api you need to first add the following line to your plugin.yml:
Then you need to add your playtimerewards jar as a dependency the same way you did with the bukkit jar (unless you used maven, in which case you go into the dependencies area of project structure for intellij, although I'm not quite sure how this is done in Eclipse, it'd be if someone could tell me so I could put it here ).
After that you need to access the instance of the plugin by using the following line of code:
PlayTimeRewardsRecoded PTRR = PlayTimeRewardsRecoded.Instance;
(The PTRR can be renamed to whatever you like, just be sure to change it everywhere else you use it!)
Then you can get a player's playtime and last login by passing their UUID into the following functions
PTRR.PTRgetPlaytime(PlayerUUID) - returns a long (format is year/month/day)
PTRR.PTRgetLastLogin(PlayerUUID) - returns a string
Btw once I release the leaderboards function they will be gettable from the API.
If you need help just ask in the discussion section!
PlayTimeRewards should work fine with all versions as it contains no version dependent code, but may break with some versions.
Be sure to check out my other resources!
Reward players for hours of play & daily joins!