GiftEvents
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.
McStats
GiftEvents is using McStats to collect some data such as operating system, java version, Amount of players and some more.
You can learn more about it here.
You can disable it in the config file in the plugin directory.
Screenshot
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 and examples 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. In case of spawn eggs use 383 as ID and the entity ID as damage value. All entity types can be found in the official Minecraft wiki.
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.incremental - Default: true
- giftevents.admin - Default: false
@omwah: This Plugin is tons of fun! My server mates and I love it! I did have a question about gifting spawn eggs. Is it possible? It's not on the material class documentation list and I'm having trouble finding the proper item IDs.
If it is possible to gift spawn eggs, I was also wondering if we could go as far as to set their age. I was looking at this page: http://jd.bukkit.org/dev/apidocs/org/bukkit/entity/Ageable.html#setAgeLock(boolean) And now I really want to give everyone permanent baby wolves. :P
Any info you have would be fantastic. Again, GREAT plugin!
@omwah
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.
@MisterMystery
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.
The items line should be as follows:
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.
@omwah
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.
@MisterMystery
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.
@MisterMystery
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!
Do you know the code for infinity enchantment?
enchantments: {INFINITY: 1} isn't working it seems.
Thanks
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?
@konradmm
Thanks!
nice plugin bro! keep up good work!
I love that the plugin is including anniversaries too. Putting this plugin on my watch list.
Sounds like a nice concept. Would be neat to try it out when done!