Tutorials/2. Basic Rewards

Basic OnTime Rewards

The OnTime Rewards system is very flexible and offers many different features, that when combined can create a large varity of playtime-based reward systems. In this tutorial I will be covering the most basic aspects of the OnTime Rewards solution so operators can quickly get something setup.

In this tutorial I will cover:

  • Basic configuration setup to use the OnTime Rewards system
  • Creation of regular (standard) OnTime Automated Rewards
  • Definition of Item, Econ, and XP rewards

Basic Configuration


The base plugin configuration is found in /plugin/ontime/config.yml, and there are a couple of things that need to be set here to enable the rewards system. When first downloaded, the plugin has the rewards system enabled by default, so unless you have changed something, the following is just for your information.

The OnTime Rewards system must be enabled, and if you want players to receive notice when they get a reward, that must be enabled too.

from config.yml

# Enable if OnTime Rewards system to be enabled
rewardsEnable: true

# Enable if Reward Notification Messages to players should be displayed
rewardNotifyEnable: true


There is an additional configuration file plugin/ontime/rewards.yml that is used to configure the various pieces of the OnTime Rewards system. For this basic tutorial though, there is no need to edit it directly. I will touch upon it again at the end of this tutorial, but for now we will just ignore it.

'Adding' basic rewards

Let’s say I want to reward my players once they have been on the server for one hour of playtime, eight hours of playtime, and one day of playtime. I want to give them 100 coins, 1000 XP, and 3 Diamonds respectively. To do this I will execute the following commands:

ontime rewards add econ 100 1h
ontime rewards add xp 1000 8h
ontime rewards add item 3 diamond 1d

The command syntax is 'ontime rewards add <reward type> {<quantity>} <reward> {<days>d <hours>h <minutes>m} {[tag=]<RewardTag>}'. The <quantity> parameter is only used for the 'item' rewards.

That’s it! The system will now issue these rewards, once per player, at the times specified.

Viewing Rewards

There are a couple of ways to get information about the rewards from the plugin.

ontime rewards list

To see all of the rewards defined on the server, you use the following command in the console or in game:

ontime rewards list

This will generate the following output for the rewards I defined above:

2013-03-23 17:57:42 [INFO] #1 Total: 1H                R: 100  (SA)
2013-03-23 17:57:42 [INFO] #2 Total: 8H                R: 1000 XP (SA)
2013-03-23 17:57:42 [INFO] #3 Total: 1D                R: 3 of diamond (SA)      

The "(SA)" at the end is shorthand for the type of reward. S = Standard (automated) and A = All (available to all players).
The order number at the front of each of these lines will be important in later tutorials. This number is the RewardID and is used in other commands to specify a reward you are looking to modify.
An alternative to the RewardID for referencing a specific reward is the RewardTag. A “RewardTag” is a string identifier of a reward that can be specified by the admin or auto-generated by OnTime. The RewardTags can be displayed by adding the [tags] keyword to the list command:

“/ontime rewards list tags”

ontime rewards info

A greater amount of information about existing rewards can by seen with the “info” command.

/ontime rewards info <rewardID/RewardTag/all>

The information included in the info output is:

  • RewardID
  • Reward Type
  • Reward Flags
  • Reward Issue time
  • RewardTag
  • Reward Recurrence interval (for recurring/perpetual rewards)
  • Reward valid world
  • Reward Permission String (for exclusive rewards)
  • Reward Permission Groups (for exclusive rewards)
  • Reward Count (for recurring, referral, and votifier rewards)

ontime <playerName>

You can also see the rewards pending for a given player by using the base 'ontime' command:

ontime <playerID>

for example:

ontime rewards next

With the 'ontime rewards next' command you can see pending rewards for all online players.

/ontime rewards next


As promised I came back to the rewards.yml file, as it too can be viewed to see what rewards are defined for your system. Here the commands exectued have been translated into a 'OnTimeonyml file itself.

My example rewards are defined in this file as:

- S,A,T,P,null,default,0,1,0,0,0,0,-1,E,1,100,S0ECONOMY1100
- S,A,T,P,null,default,0,8,0,0,0,0,-1,X,1000,XP,S1XP1000XP
- S,A,T,P,null,default,1,0,0,0,0,0,-1,I,3,diamond,S2ITEM3diamond



Posts Quoted:
Clear All Quotes