[ADMN/MISC] LoginBonus v0.6 - Reward Loyal Players When They Login. [1185]

Discussion in 'Inactive/Unsupported Plugins' started by BeerHuntor, Sep 10, 2011.

  1. [​IMG]

    LoginBonus - Reward Loyal Players
    Version: v0.6

    <font color="rgb(255, 0, 0)">Now on bukkitdev </font>http://dev.bukkit.org/server-mods/loginbonus/

    This is one of my first plugins that I have built, nothing special, quite simple really, but I thought
    I would share this anyway.

    * Rewards players on login with a diamond.
    * Automatically goes into the players inventory
    * Permissions Supported
    * Now only activates every 24hours.
    * Reward is configurable.
    * Time is configurable.

    Permission Nodes:


    <Edit by Moderator: Redacted mediafire url>

    Show Spoiler
    package me.beerhuntor.LoginBonus;
    import java.util.logging.Logger;
    import me.beerhuntor.LoginBonus.LoginBonus;
    import org.bukkit.event.Event;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    public class LoginBonus extends JavaPlugin{
        LoginBonusPlayerListener playerListener = new LoginBonusPlayerListener(this);
        private Logger log = Logger.getLogger("Minecraft");
        public void onEnable() {
            PluginManager pm = this.getServer().getPluginManager();
            pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
            this.logMessage(" Has been enabled.");
        public void onDisable() {
            this.logMessage(" Has been disabled.");
        protected void logMessage(String msg){
            PluginDescriptionFile pdFile = this.getDescription();
            this.log.info("[" + pdFile.getName() + "]" + " " + pdFile.getVersion() + ": " + msg);
    package me.beerhuntor.LoginBonus;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerListener;
    import org.bukkit.inventory.ItemStack;
    public class LoginBonusPlayerListener extends PlayerListener{
        public LoginBonus plugin;
        public LoginBonusPlayerListener(LoginBonus instance){
        public void onPlayerJoin(PlayerJoinEvent event){
            Player p = event.getPlayer();
            ItemStack i = new ItemStack(Material.DIAMOND,1);
            p.sendMessage(ChatColor.AQUA + "You have recieved a Login Bonus of a Diamond! ");

    To Do.

    * Add Config File to allow more configuration - Added v0.3

    * Add a timer so it can only be used every 24hours? - Added v0.2 (Thanks @tips48)
    * Add iConomy Support (WIP)


    version 0.6 -
    Fixed the configuration syntax error when creating the config file

    version 0.5 -
    Simplified the time configuration from milliseconds to hours

    Show Spoiler
    version 0.4 -
    Made the time as a configurable option.

    version 0.3 -
    Added config file. Reward is now configurable.

    version 0.2 -
    Added the source to only allow the bonus to be given once every 24 hours - Thanks to @tips48

    version 0.1 -
    Released LoginBonus
    Last edited by a moderator: Nov 12, 2016
  2. Offline


    2nd to do is REALLY important because otherwise they could login/logout x times and would always get a diamond
  3. Thats why I released it with permissions enabled.. That way you could limit it somewhat. Its more of finding the code that will enable me to do that. That is the problem I am currently having.
  4. Offline


    yeah i want my players to have a bonus but not unlimited. if you make a config file it will be great. anyways, nice plugin!
  5. Thanks for the feedback :)

    Updated to v0.2!

    Added the timer so only gives out every 24hours.

    Now have a bukkitdev page -- http://dev.bukkit.org/server-mods/loginbonus/

    EDIT: Should of been in the previous post... oooops :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  6. Offline


    Please add iconomy support ;)
  7. Offline


  8. Ill fix it thanks for the heads up :)

    Im planning on adding it at some point. Cant give an exact time frame yet tho.
  9. Offline


    Would there be a way to config the timer, and the bonus? Because if so, I'd certainly download this plugin! It would be a good way to keep my users coming back for more!
  10. This is one thing im looking to implement. First the config for the prize, then I will add a configurable timer.
  11. Offline


    Horray! I'll keep a look out for this plugin till then! :D
  12. Could be very cool with an iConomy reward !
  13. Thats on my todo list :)

    Firstly I need to create the config file :D

    Updated with a config file, can only configure the reward as of yet.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  14. Offline


    Looks like a nice plugin!
    If you need any help with iConomy just mention/pm me.
    It's really easy.
  15. @jeroende2e Awesome, I definitely will as I have not got a clue how to use the iConomy API lol.
  16. Offline


    Can u add config for, example player need stay logged 2min for win bonus? and custom bonus is nice.

    please i'm waiting for it :(
  17. Offline



    The set up is very easy.
    and using it also.
    all you have to do is make a ServerListner class.
    put 1 thing in your main class. and then you can use all API
    here is the link to iConomy API/connect

    if you can't figure something out just say me :)

  18. To Stay Logged In??? Hmmm im not sure how that would work. Let me get back to you on that :)

    Awesome. Ill do that. Thanks :)

    Updated to 0.4 With a configurable time option.

    Updated to 0.5

    Simplified the time configuration.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  19. Offline



    good option is,
    VIP,NORMAL, etc


    config file:
    login bonus amount= 10
    login bonus type=Diamond_block
    message = Hello VIP today your bonus login %AMOUNT% %ITEM ID%

    login bonus amount:1
    login bonus type:Diamond_block
    message = Hello USER today your bonus login %AMOUNT% %ITEM ID%

  20. Ill add that to my notes :) And look into it :)

    Thanks for the feedback.
  21. Offline


    The SECOND you release iConomy support im on the bandwagon.
  22. Im currently working on that now :) So should be pretty soon :)
  23. Offline


    Good, just make sure to add a lot of customization, I really hate most default settings.
  24. Such as? .. The current config it has atm is, prize, time, and price (once i hook into iConomy) not really sure how much more customization i can get .
  25. Offline


    The default config file it generates has a syntax error.

  26. Ill get that sorted now.

    @S4h4rk Ive fixed the bug mate. Re download it from the OP, and it should work fine :)

    Updated OP.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 19, 2016
  27. Offline


    Cool. Thank you for the quick updated to fix this! :)
  28. Offline


    Awesome! When iConomy 6 support is added it will be even more awesome ;)
  29. No problem.

    I am currently working on this but as i have never used iConomy before it proving to be harder than anticipated. But nevertheless, onward and upward :)

Share This Page