GiftEvents

Enjoy your Cake

About

This plugin handles giving out gifts to players when they join on certain types of days:

  • Their birthday if registered
  • Their first played anniversary
  • Arbitrary defined dates

For any event an announcement can optionally be made to all players. For instance, for their birthday you might configure a message letting everyone know its their birthday. Gifts can optionally be received after an event should the player miss logging on. You can configure any number of items to give to a player and each item can have any number of enchantments. Items are given when the player logs on.

Safeguards are in place to keep a player from changing their birthday to get additional gifts and to keep announcements from occurring too frequently. Even if the player changes their configured birthday to another date they will not receive another gift till the following year.

Screenshot

Enjoy your Cake

Commands

  • /birthday get - Gets a player's birthday if set
  • /birthday set MM-dd - Sets the birthday for a player
  • /anniversary - Gets a player's first play anniversary, the date when they first joined the server
  • /events list - Lists all configured events and their dates
  • /events info - Detailed info about an event, including which gifts are given
  • /events give - Admin command to give the items from an event to a player
  • /events reset - Admin command to reset the gift status of a player for an event
  • /events reload - Reloads the events config file from disk

Configuration

The are a few options in the config file, but most modifications take place in the events file. Both contains plenty of comments to help you get started configuring events.

When configuring items use either the Minecraft item id number or a name as it appears in the Bukkit Material class documentation. For enchantments you can again use a numerical enchantment id or the enchantment's name in the Bukkit Enchantment class documentation.

When testing a configuration use the "/events reload" command to check for errors without needing to restart the server.

Permissions

The permissions are very simple and allow you restrict access for certain users:

  • giftevents.birthday - Default: true
  • giftevents.anniversary - Default: true
  • giftevents.events - Default: true
  • giftevents.admin - Default: false

Code

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Lionhard98 Lionhard98 Dec 02, 2013 at 20:08 UTC - 0 likes

    @omwah: Go

    Does that "ARROW_INFINITE" make the items infinite? would be cool :D (didnt test it so asking :D)

    BFAK:90899452,61a2eac60acab50d41fdde6f365b843d09f9b09b450b3baea87f58f6bb3c5c88

    My plugins: Informative | QuickSupport | uReview

    Do you have any questions, ideas or requests? Send me a PM!

  • Avatar of MisterMystery MisterMystery May 21, 2013 at 01:23 UTC - 0 likes

    @omwah: Go

    I am using the new one with the events.yml. Thank you for the correction!

    while we're exchanging ideas: These are the two that I've added to your default that seem to work now (thank you)

    halloween: date: 10-31 belated: False gift: items: - { id: POISONOUS_POTATO } # Poison Potato - { id: GOLDEN_APPLE } - { id: 91, amount: 2 } # Two jack-o-lanters name: "Trick or Treat!" message: "Happy Halloween %1$s, check your inventory for a gift!"

    valentines: date: 02-14 belated: False gift: items: - { id: RED_ROSE, enchantments: {ARROW_INFINITE: 1} } name: "I love you!" message: "Happy Valentines Day %1$s, check your inventory for a gift!">>

    <</code>>

    I"m currently brainstorming ideas for St. Patricks day and 4th of July (maybe just lots of fireworks?) And I like the idea of giving 9 torches (candles) on Hannukah - but its different every year. So its hard. :) Or perhaps 1 torch on every new day of Hannukah.

    Anyway, awesome plugin I really love it.

    Last edited May 21, 2013 by MisterMystery
  • Avatar of omwah omwah May 21, 2013 at 00:24 UTC - 0 likes

    @MisterMystery: Go

    I also added an issue for myself to add this great example to the default events.yml file. You can see a better formatted copy of the configuration here.

    Thanks.

  • Avatar of omwah omwah May 21, 2013 at 00:06 UTC - 0 likes

    The items line should be as follows:

        - { id: RED_ROSE, enchantments: {ARROW_INFINITE: 1} }
    

    The correct name for the rose is RED_ROSE. Also you need to specify a enchantment level for the ARROW_INFINITE, above I put 1.

    Check the Bukkit Material page for the correct name of items:
    http://jd.bukkit.org/beta/apidocs/org/bukkit/Material.html

    Also if you are using the latest version of the plugin then the events now go in events.yml. This is to keep the plugin from crashing due to incorrect syntax. When you run this version for the first time it will move things out of config.yml. Or you can just back up your old plugins/GiftEvents dir and let the plugin regenerate from the defaults.

    When you do edit the events.yml you can check it without reloading the server by using the "/events reload" command.

    Last edited May 21, 2013 by omwah
  • Avatar of MisterMystery MisterMystery May 20, 2013 at 23:00 UTC - 0 likes

    @omwah: Go

    What am I doing wrong with this:

    valentines: date: 02-14 belated: False gift: items: - { id: ROSE, enchantments: {ARROW_INFINITE} } name: "I love you!" message: "Happy Valentines Day %1$s, check your inventory for a gift!"

    when I take it out /events works just fine. but when I add it to the events.yml and restart doing the command /events gives "events - ?" Which usually means there's an error.

  • Avatar of omwah omwah May 20, 2013 at 02:27 UTC - 0 likes

    @MisterMystery: Go

    Use ARROW_INFINITE or the numeric id: 51.

    The names accepted are the enum values from the Bukkit Enchantment class: http://jd.bukkit.org/rb/apidocs/org/bukkit/enchantments/Enchantment.html

    I will be the first to admit that the Bukkit names are odd at times.

  • Avatar of omwah omwah May 20, 2013 at 02:25 UTC - 0 likes

    @MisterMystery: Go

    This is due to Java's soft rounding of dates. I will keep this in mind to fix. But its a low priority given the percentage of people with that birthday!

  • Avatar of MisterMystery MisterMystery May 20, 2013 at 02:20 UTC - 0 likes

    Do you know the code for infinity enchantment?

    enchantments: {INFINITY: 1} isn't working it seems.

    Thanks

  • Avatar of MisterMystery MisterMystery May 18, 2013 at 07:23 UTC - 0 likes

    For some reason, just so you know, whenever someone has a birthday on 02-29 the plugin recognizes it as 03-01.

    It's impossible for someones birthday to be February 29th. :)

    Fix?

  • Avatar of omwah omwah Mar 12, 2013 at 17:36 UTC - 0 likes

    @konradmm: Go

    Thanks!

Facts

Date created
Mar 05, 2013
Category
Last update
May 09, 2013
Development stage
Release
License
GNU Lesser General Public License version 3 (LGPLv3)
Curse link
GiftEvents
Downloads
1,305
Recent files
  • R: v2.0 for 1.5.2 May 09, 2013
  • R: v0.1.3 for 1.4.7 Mar 12, 2013
  • B: v0.1.2 for 1.4.7 Mar 10, 2013
  • B: v0.1.1 for 1.4.7 Mar 07, 2013
  • B: v0.1.0 for 1.4.7 Mar 07, 2013

Authors