Surprise Bags
Description
This plugin adds various treasures and surprise bags to your world. These special items will be dropped by naturally-spawned monsters such as Zombies and Spiders. When players obtain the surprise bags, they can open them by clicking the right mouse button while holding them. They will then get a random item and the bag will disappear.
The list of surprise bags is set in the configuration files of the plugin, as well as the list of items that the player can receive when opening each bag. The plugin comes with a predefined set of bags:
- Treasure
- Trick-or-treat Box (perfect for Halloween)
- Surprise Bag
- Unknown Book
- Wintersday Gift (perfect for Christmas)
Each such item has a different drop-rate. Please see the configuration files for more information.
For example, players who open an Unknown Book might get a sharpness I enchanted book or a different enchanted book. Trick-or-treat boxes might get the player a raw fish, a pumpkin pie or, rarely, a diamond helmet.
Commands
There is one main command and several sub-commands:
- /surprisebags version - Get the plugin's version.
- /surprisebags spawn <bag> [count] [player] - Give you or a player a bag by name.
- /surprisebags list - List of existing bags.
- /surprisebags edit <bag> - Edit the bag's contents.
- /surprisebags save <bag> - Save the bag's contents to the configuration file.
- /surprisebags addbag <bag-id> [name] [drop-chance] - Add a new bag
- /surprisebags removebag <bag-id> - remove a custom bag
- /surprisebags reload - Reload the configuration files.
Permissions
There are three permission settings:
- surprisebags.command - Allows you to use the SurpriseBags admin command (defaults to admins only).
- surprisebags.openbag - Allows you to open bags (defaults to everyone).
- surprisebags.edit - Allows you to edit or save the bags contents (defaults to admins only).
Configuration
You may add/remove surprise bags by using the in-game commands. You can change different settings by editing config.yml, which is in the plugin's folder after installation. Each bag has its own YAML file, where you can list the items that players will receive when opening the bag. The players will always receive exactly one item, so adding many items of the same type will increase the chance of receiving them, whereas items which appear only once will be rare. You may open the configuration files of any of the predefined bags (e.g. Trick-or-treat box) to see how these lists work.
You may change the general drop-rate of bags, as well as the specific drop-rate of each bag.
If you have WorldGuard installed, you may limit the drops to one region. The region ID is set on config.yml.
If you want a bag to drop from a specific list of mobs, you can add the "limit-mob" setting to the bag's yaml file. For example:
# # Limit Mobs # # Limit the drop of this bag to the listed mobs only. # limit-mob: - creeper - zombie
Note that this should be in the bag's file, not in config.yml (in other words, it is defined per bag).
Yeah that fixed it, but once i added new items i got the error again.
Whats the issue this time :P
http://pastebin.com/sVnnGgNC
@Lobomite
You added an item called BROWN_MUSRHOOM
It should be BROWN_MUSHROOM
Please let me know if this fixes the issue.
@eyalzh
So basicly when ever i tried to add a new item i got that error
Here's the configuration:
http://pastebin.com/21XbahAS
@Lobomite
Can you post the wintersday-gift configuration. There might be an error in that configuration file.
http://pastebin.com/ysd9M4Am
Whats the matter?
@redstonehax
What Bukkit version are you using? Can you pastebin the server log after reload?
I would love to use this plugin for a server that I am making but when I put it into my /plugins directory and reload/restart my server it doesn't do anything, no folder is generated no commands from the plugin work, can you please fix this issue?
@eyalzh
Can't you just make it so that on block break event, it is a 2/100 chance of running the command "/surprisebags spawn <bag> <amount> {player}".
They could create it in config.
@iKilledEveryone
No, you can't. Interesting idea, though. Thanks.
@xXSkater29Xx
There is only a way to specify failure messages (like in trick-or-treat). I'll think of adding ranom message in addition to a random item, as well as economy integration.
This looks very useful, good job. I'll bookmark it for a future server project :)
One question/request: Are you able to add surprise bags from breaking blocks? (ie. 2% chance to drop a treasure chest from mining/digging)
I was kinda asking the same thing, for instance if they get a CUSTOM bag and right click it, it could run something like /pay or /say.
@broluigi
Not sure what you mean by commands. If you create a bag with just a single item, that item will always be given when opening the bag. That could be any item whatsoever, even items spawned by other plugins (just make sure to use the in-game edit command). That's an easy way to add drops to the game without the random effect and with a spy message.
Can you make it so that i could make custom suprise bags that can run commands? Like a suprise bag that spawns in a custom item on right click
You should add an option to have a player spawn in with a surprise bag (or one of your choice) and you can also set it as like you get a bag if you join everyday, (1 a day) and an option for the bags to give you a random amount of money
@broluigi
That permission exists: surprisebags.openbag
can you make it so that i can make it so people with certain permission can open the bags? i need to make it so non donators can get them but cannot open them
@Venusaur
That feature was added in 1.8.6.
This could be something really useful if you could give bags to players via a command.
I have a suggestion that would widen the uses of this plugin.
I was thinking you could add a function where an admin or player with permissions could give bags to players with a command /sbag give [player] [bag]
This could be used as a sort of reward system. When a player for example wins a competition or event, the admin can give the player a bag and the player gets to open it and get the reward inside.
I was looking for a plugin where admins could reward players with a bag or crate that would give them a random item. I like MysteryCrates, but it's outdated and doesn't work properly anymore, though that plugin had certain "kits" implemented in his plugin, so that players had a chance to get several items in one crate. You could look up the plugin if you need some suggestions on how to improve your own.