DropSwap
Kalem's
DropSwap
Kalem's DropSwap plugin is a Bukkit server mod that monitors creature deaths and block breaking, looks at the drops, then swaps items and quantity.
____
Updated for Bukkit 1.5.1 R0.1
Tested and working with Bukkit-1.5.2-R0.1 (Build #02754)
____
Features:
- Select creatures/blocks to monitor
- Specify drops to monitor
- Swap existing drops (Have spiders drop web instead of string!).
- Add new drops (Have zombies drop feathers again!).
- Remove drops (No more rotten flesh!).
- Give a range for the minimum and maximum number of additional/swapped items to drop.
- Set the chance for an add/swap/remove attempt to be successful.
____
Simple to set up:
After putting dropswap.jar in you server's plug-in folder, reload your server to create the default config.yml file. By default, DropSwap will add feathers to Zombie drops 50% of the time, and will turn Spider drops of string into Spider drops of web.
To modify DropSwap, just edit the config.yml file in the plugins/DropSwap folder using the following options:
LOGGING SETTINGS
- INFO - Show all information to the console
- SEVERE - Reduce logging to only errors (default)
[Must be upper case]
PERMISSION SETTINGS
PERMISSIONS: REMOVED! Causing too many complications and kept me from keeping plug-in up to date.
DROPSWAP SETTINGS
- ENTITY|MATERIAL:SUB, ACTION: <DROP ITEM>:SUB, <SWAP ITEM>:SUB, <CHANCE>, <MIN>, <MAX>
- ENTITY: the string name of the monster/creature/animal to modify (required)
(use ALL for ENTITY to include all creatures including farm animals, pets, etc)
NOTE: ENTITY must be the string name of the creature
(use ANY(no sub-type) for MATERIAL to include any block including leaves, grass, flowers)
NOTE: MATERIAL can be the string name or the integer ID of the block
- SUB: Separated from the blocks by a COLON(:), the SUB-ID allows selection of sub-types (optional - integer only)
- ACTION: choose from additem|swapitem|removeitem (required)
- DROP ITEM: original item that entity drops (required for swapitem|removeitem)
- SWAP ITEM: item that is swapped for original item (required for additem|swapitem)
- CHANCE: a floating number (decimal required) for chance that add/swap/remove will occur (required if using max or min/max)
- MIN: the minimum number of swap items to allow (must come before max if used, 1 is min if not used)
- MAX: the maximum number of swap items to allow (required if min is used, can be equal to min)
____
Config.yml Example
dropswap:
- ALL, additem, GOLD_NUGGET, .10
- SPIDER, swapitem, STRING, WEB, 1.0, 1
- ZOMBIE, additem, FEATHER, .50
- ZOMBIE, removeitem, ROTTEN_FLESH, 1.0
- SQUID, additem, RAW_FISH, 0.8
- GLASS, additem, GLASS, 1.0
- LOG:2, swapitem, 17:2, 17:3, 0.5
____
Future:
- Suggestions welcome
____
I'd love to hear from you
Kind and constructive feedback is appreciated. Tickets will be responded to as soon as I can. No plug-in compatibility has been tested.
____
Cheers,
- Kalem
The plugin works successfully, it also works with the permissions system pex. but every time you kill a mob fills the console a lot of spamm. would be possible to enable or disable this spamm in the config? I also have a proposal: if an administrator wants to create a class that receives drops different from everyone else, what they should do? for now I haven't found how can it is possible, and then I propose to put a prefix created specifically for permits assigned to a certain class such as:
- prefix 1: - COW, removeitem, RAW_BEEF, 1.0 - prefix 2: - COW, add item, APPLE, 1.0 - prefix 3: - COW, add item, SEEDS, 1.0
perfect! thank's a lot for your job. looking for an update :)
@gladiozzo
Thank you for the suggestion.
In your example, you seemed to want the drop based on the entity (i.e. zombie), so this would mean that some people would get drops from zombies, and some would not. So groupA gets rotten flesh, and groupB gets nothing. Means that killing zombies is valuable to one group but not another.
I'll look into permissions and see what this will take. I will have to check that permissions are checked at the time the drop event occurs for the player.
I'm going to be adding DropSwap features to block-breaking as well. Sounds like this might be useful there as well.
Is useful if the server is divided into classes. For example, only farmers can collect seeds and only miners can collect diamonds. This will encourage players to work together.
@gladiozzo
Hello. Can you help me with a use case (i.e. tell a little story about how this would work in game, with different players having different permissions)?
You can add permissions for each drop? such as: dropswap.zombie: true
@dick_deck
Found the error. Thank you for the assist! Turns out that I had set up my config.yml file to have default values that it shouldn't have. Should be fixed now, but had to change how I formatted and parse the config.yml file. Remove the old config.yml file.
Thanks again for the help. The key was that you had removed a line. Let me know if you find any more fun stuff for me to fix.
Have fun, - Kalem
@dick_deck
You are correct that it is a YML file not an XML file. Sorry about that. I have fixed it in the description.
Are you able to get to the server logs? I might want to take a look at them. But the default is minimum logging and to change the logging level, you have to use the config.yml file. So I might push out another release that defaults to more verbose logging while this is a beta release.
This is really odd. I will experiment some more when I can get to my development machine.
Thanks again for the help and feedback.
- Kalem
So I removed all of my other mods hoping to find which one was causing the problem. (I also made sure by Bukkit server was 1.2.5.)
After starting and restarting the server I found the yml file still reset.
As for the changes I took this:
SPIDER: swapitem: STRING, WEB ZOMBIE: removeitem: ROTTEN_FLESH, .25 additem: FEATHER, .50
and made it:
SPIDER: swapitem: STRING, WEB ZOMBIE: removeitem: ROTTEN_FLESH, 1.0
For the purposes of testing I kept it simple. However zombies were still dropping feathers, and when I closed the server and checked the yml file it was reset.
Going back up and reading to make sure I shouldn't have need another plugin like Spout, I also noticed your instructions mention an xml file, not yml. So I renamed the file, edited it, started and restarted the server, and it created a new yml file.
Sorry I could not be of more help!
@dick_deck
__
Thank you for taking a look at my plug-in. And thank you for the feedback.
I attempted, but was unable, to re-produce the problem both on a local PC server and on my Clanforge/Multiplay server. Both restarting the servers and using the /reload command kept my changes.
My only suggestion is to make sure you do not have any TAB characters in the YML file. Tabs are not allowed in YML files and will cause import errors.
Please make sure you are using the latest Bukkit release (1.2.5).
If you have more information to share (other addons, what you changed in your YML file, exact step if you think it would help, etc.) I'd be happy to take a look.
Have fun, - Kalem
Every time I edit the yml, when I restart the server it is reset. :(