Ever wanted to reward players for directing people to your server? see your server empty most of the time? then Referrals is for you! Referrals is a super-configurable plugin that allows you to award players who bring new people to your server. So, how does this work? basicly, users can generate referral codes using the command /generatecode. these codes can then be used by new players using the command /redeem <code> this will give the player and the referrer configurable prizes in the form of items, economy or even make it run console commands! players can also use the command /referstats to view how many people they have referred or /codes to view their current active codes.
/redeem has be changed to /redeemcode in v0.42 and above!
- Messages Config
- Give players prizes in the form of money, items or even make it run console commands for referring another player to your server
- help page /help referrals
- configurable number of maximum codes
- configure the required playtime of a player for them to be allowed to generate a code
- create custom codes
- set whether to use player names instead of codes
- code deleted after use
- Checks if players have played before when plugin is started to ensure old players don't refer each other
- Players cannot refer themselves
- Players cannot refer users from the same ip address
- players cannot redeem more than 1 code
- Config auto updates with updates
- log file which logs all records of referrals (turned on by changing value "showReferralsLog" in config to true)
- view stats about how many people you/another player has referred
- config option to only allow players to redeem a code the first time they log in
- config option to deactivate old users codes
- 839,299,365,868,340,224 possible codes, Thats over 839 Quadrillion!
ShowCase by SGTCaze
How to Use
- The player who wants to refer another player types /generatecode to generate a code for the other player to use. They can also use /codes to view their active codes. A maximum amount of codes can be set in the config.
- The player who was referred logs in and is prompted with a message telling them to use the command /redeem <code> to redeem a referral code. The message can be changed in the massages config.
- Both players recieve configurable rewards for referring someone and redeeming a code (to make it worth actually using the /redeem command). You can also add special prizes for when they reach a certain number of referrals.
Below is a list of commands and what they do
[ ] = Optional < > = Necessary
/redeemcode <code> - The command used to redeem a users code, declaring that they referred you.
(In versions before v0.42 use /redeem)
/generatecode [code] - The command used to generate a code to be used in /redeem <code>, If enabled on server when you type /generatecode with a code after it it will create a code called that.
/codes - The command to view your active codes.
/refertop [page] - Allows you to view who the top referrers are on your server.
/referstats [player] - Allows you to view the referral stats of the given player. defaults to sender if no player is named.
/help referrals - Displays the referrals help page
/fixrefferers - Sets all players play time to 0, used for if you are recieving glitch when players cant use /generatecode because it says they have to play another ridiculous amount of time.
How to Install
To install this plugin simply drag the referrals.jar file into your servers plugins folder and then restart your server!
below is a list of permissions along with a brief description on what they do and what they are defaulted to. Do not add the colon ( : ) to after the pemission that is just to show that it is associated with the lines following it.
referrals.fix: description: Allows you to use /fixreferrers default: false referrals.redeem: description: Allows you to redeem someones code in-game default: true referrals.generate: description: Allows you to generate a referral code default: true referrals.stats: description: Allows you to view your referral stats default: true referrals.top: description: Allows you to view the referral top list default: true
Set Rewards for when players reach certain goals
Many people have made it obvious in the comments that they dont know how to set rewards at certain goals. To do it read everything in the config section under Prizes.
Below is the default config along with a list of what all the values do.
showReferralsLog: false loginMessageDelay: 40 usePlayerNames: false allowCustomCodes: false autoUpdate: true checkIpAdress: true onlyAllowReferralsFirstLogin: true requiredPlayTime: 0 maxCodes: 1 useEconomy: false removeOldUsersCodes: 14 Prizes: onRedeem: money: 20 items: - DIAMOND:0:2 commands: onEvery: money: 100 items: - DIAMOND:0:5 commands: on5: money: 500 items: - DIAMOND:0:10 commands: - referstats @p
showReferralsLog: false - sets whether a log should be created with records of all referrals
loginMessageDelay: 40 - sets the delay time for the messageFirstLogin message. counted in ticks (20 ticks = 1 second).
usePlayerNames: false - true or false, sets whether to use player names instead of codes for referring people
onlyAllowReferralsFirstLogin - true or false, sets whether players can only use the command /redeem <code> when they first login.
maxCodes - a number, sets the maximum number of active codes the player can have at any one time.
useEconomy - true or false, sets whether or not to use economy integration for giving money to players when they refer a player or redeem a code.
checkIpAdress - true or false, sets whether to block people being referred by another user using the same ip address. Can be used to stop people using their multiple accounts to get free rewards.
Prizes - the list of all prizes that can be awarded to players. onRedeem will be given to players who redeem a code and onEvery will be given to players who refer someone unless they hit a referrals milestone. on<number> will be given to players when they hit the required number of referrals. Example: "on5" will give players who hit 5 referrals the configured items.
money - a number, sets the amount of money the player will be given when they recieve a prize. Only works if useEconomy is set to true
items - a list of items to be rewarded the the players, it goes NameOfItem:dataValue:amount. for example "DIAMOND:0:50" would give the player 50 diamonds. If you do not want to give the player items just clear everything after items: but do not remove the items:
commands - a list of commands to be executed upon the receiving of a prize. You can use the symbol "@p" to use players names, just type in @p and it will be replaced with the players name or @r and it will be replaced by the player who was referred or if used in onRedeem it will be replaced with the referrers name. Example: "gamemode 1 @p" this would set the gamemode of the player who recieved the prize to 1 or "gamemode @r 1" would set the referred player to gamemode 1.
requiredPlayTime - the required play time of the player to refer someone, counted in minutes.
removeOldUsersCodes - the amount of days before old users codes will be removed, set to 0 if you do not want them to be removed.
referrals contains a custom config file for messages. Below is the default messages config along with how to use it.
To use colours in your messages simply use the chatcolor numbers/letters with an & sign before them. For example "&cpotato!" would make the text potato! red.
there are also special codes beginning with an @ symbol to include names of players/codes to your message. Note these are only available in some of the messages.
@n - gives a players name, could be who referred you or who redeemed your code.
@c - displays the referral code instead of the @c
@r - displays the number of referrals the player has made
MESSAGE_FIRST_LOGIN: "&aType /redeem <code> to set who referred you and get some &6Free Items!" MESSAGE_INVALID_CODE: "&cThe code you have entered is invalid" MESSAGE_INVALID_PLAYER: "&c unable to find the player @p" MESSAGE_INVALID_PAGE: "&cThere is no page number @n" MESSAGE_NO_PERMISSION: "&cSorry, You do not have the required permissions" MESSAGE_NO_CODES: "&cYou have not generated any codes, /codes to view your codes" MESSAGE_NOT_PLAYER: "&cYou must be a player to run this command" MESSAGE_VIEW_CODES: "&a Below is a list of all your active &6referral codes" MESSAGE_VIEW_CODE: "&a - &[email protected]" MESSAGE_VIEW_STATS: "&aYou have referred &[email protected] &apeople" MESSAGE_VIEW_STATS_OTHERS: "&[email protected] &ahas referred &[email protected] &apeople" MESSAGE_REFFER_SELF: "&cYou can not refer yourself!" MESSAGE_SAME_IP: "&cYou can not refer someone with the same ip address as you!" MESSAGE_TOP_HEADER: "&aReferrals top, Page &[email protected]" MESSAGE_TOP: "&[email protected] - &[email protected]&a: &[email protected]" MESSAGE_NOT_NUMBER: "&[email protected] must be a number" MESSAGE_MAX_CODES_REACHED: "&cYou have already reached the max amount of codes, /codes to view your codes" MESSAGE_REDEEM_REFERRERS_CODE: "&cyou can not have been referred by the person you referred" MESSAGE_REFERRED: "&[email protected] has redeemed your code" MESSAGE_ALREADY_REDEEMED: "&cYou can only redeem 1 code" MESSAGE_BELOW_REQUIRED_PLAYTIME: "&cyou must play another @t minutes before you can refer someone" MESSAGE_BEEN_REFFERED: "&aYou have been referred by &[email protected]" MESSAGE_CREATE_CODE: "&aSuccesfully registered code: &[email protected]" MESSAGE_FIX_REFERRERS: "&cSuccesfully fixed referrers" MESSAGE_USEPLAYERNAME: "&cThere is no need to generate a code, you can just use your username!"
The source for referrals can be found inside the jar, feel free to take a look.
How to use on Bungee Servers
If you were to run this plugin on a bungee server you may find that it will disable you from being able to refer players and it will send you the message "you cannot refer players with the same ip address" or something along those lines.
to fix it simply go to the config and change the value "checkIpAdress: true" to "checkIpAdress: false".
Edit: you can also if you want set it to use the players actual ip address on bungee to ensure people dont refer people on the same ip address. Thanks to theoneofcheese123 for telling me about this.
To set bungee to use players actual ip addresses simply go into you bukkit.yml and spigot.yml (if using spigot) and ensure that you have both you dedicated server/VPs/server IP and 127.0.0.1 under "bungee-proxies:" like this -
That will make it so BungeeCord sends real player IP's allowing this plugin to be able to use ip checking
Found an Error?
please post below with this template and i will have a look into it:
version: error description: stacktrace(if any): config:
also please use the code tags for your config and the stack trace to make it easier to read, the code tags can be used by clicking the icon of the three cogs at the very right of the toolbar next to the link and picture icons.
This plugin uses metrics to record data. If you wish to turn this off simply go to your plugins folder then into the PluginMetrics folder and then open the file config.yml and change opt-out: false to opt-out: true. Metrics is helpful to see stats about how your plugin is going, like how many servers are using it.
Examples of what data Metrics collects:
- Server Type / Version
- Java Version
- Minecraft Version
- Metrics version!
- Amount of players
- Operating system & version
- Auth mode
What data metrics does not collect:
- Other private informations
Below is the results metrics generates.
Donating helps me find time to update this plugin! although not necessary donating is greatly appreciated! a donate button can be found in the top right of the page if you would like to help me out!
The official server of the plugin referrals is lividiusgaming, play at hub.lividiusgaming.com
Thanks for replying mate! Any eta on the next updat? At this point i kind of have to know if you are going to update it shortly or wether it will take some while so i can consider searching for something else or even make my own referral plugin for our server.
In any outcome thanks in advance appreciate your work
this sounds like a useful feature, ill try to add it soon
Thanks so much!
will be fixed in the next update, sorry for the inconvenience
can you show me your config and tell me how they are trying to refer each other
i will look into this and i will hopefully have it fixed in the next update
ill add this in the next update
it should still work with 1.7
error description: I keep getting, you can only refer people at your first login. When the accounts I am using have never logged in before. Also it ignores the setting for it in config.
stacktrace(if any): None
Is it possible to make some of the base commands less intrusive? /help is used by so many plugins (Herochat/Commandbook,etc) and having it as /referral help - would be much more intuitive.
Please update this plugin to 1.7.2?
I'd love it if you could add a Permission to override the max number of codes generated :)
That, or, a Permission Node that lets you decide this. E.G: referrals.maxcodes.x with the x being the variable (1,2,3 etc...)
I really wish your tickets page didn't try to make me log into your website.
I found a bug with this plugin. In your description, you said if you wanted the diamonds removed as a perk, just remove the line that has the diamonds and not the items line. Upon restarting the server, the diamonds line always reappears. If I delete both the diamonds and items line, then both reappear. The only way to remove the diamonds is to replace the number of diamonds with a zero or changing the item type. Please remove this feature of the line reappearing.
players cannot refer eachother :L
v0.462 second latest build make sure to disable auto update in config or it will download latest file (which is buggy) over and over again
Have have the same issue. What version are you using where it is fixed? :P
Using an older version of this plugin lets people redeem codes again, something is definitely wrong with the latest version you should have a look. It seems like the plugin always things the player has connected before
Always gives me "Can only redeem on first login" wether it is a new player or if the onlyAllowReferralsFirstLogin is set to false. Whats the meaning of this?
I'd very much appreciate some way to manually decrease/increase individual player's referral count (like a command or something). I've been catching some people abusing this by getting players they didn't refer to enter in their codes and it would be nice to be able to fix that without having to wipe everything.
i have found a glitch in my code with showing the number of referrals, yet again... but this should be the last of it. Sadly, in the transition to the new system which tracks records of all referrals all the old referrals will be wiped D:
Its okay. I know how easy it is to get busy with something.
This latest update you released tho reset referrals or isnt reading them anymore I think. I loaded the plugin, rebooted the server and it's as if no one has referred anyone.
sorry, i have been overhauling the command system in referrals recently so havent had the time to add the admin commands. i have however fixed the number of referrals issue in the last updated jar.(0.462)
Still wondering if you can get around to setting up this admin function, or even just let me know how I can manually edit or read the referrers.ref file, it's all gibberish when I look at it in notepad
I also don't know if it was an update or something, but referrers are no longer getting new referrals, everything works, they get their items, it says they got the referral, but it doesn't report in refertop, referstats, etc. So it just stays what it was, I think it's not writing to the referrers.ref file.
yes, every user can only redeem 1 code