DropFactory
A simple way to edit item drops! You can either edit the config file, or edit drops in the console.
When you first start up the plugin, it will install a rule to make grass blocks have a 50% chance of dropping diamond boots with level 2 fire protection when mined with a Silk Touch Gold Pickaxe. This is so that you have an example to work with in case you prefer to make rules by editing the config file. If you prefer to edit your drops from the console, you can remove it with the command dfrm GRASS
. Otherwise you can edit the config file and then run the dfrl
command. Changes made from the console are saved immediately to the file, so you can even mix the two methods; just keep in mind that comments will be stripped out when saving and rules may be reordered.
Commands
There are several utility commands which are subcommands of the dropfactory
command; each also has a standalone abbreviation beginning with df
. (Note: The | character indicates alternates.)
dropfactory reload|rl
:: Reloads drop rules from the config file. This reverts any rules you added or removed using commands, unless you saved them first. (Abbreviation:dfrl
)dropfactory list|ls
:: Lists all current drop rules. (Abbreviation:dfls
)dropfactory info BLOCK
:: Lists all details on the specified drop rule. (Abbreviation:dfi
)dropfactory delete|remove|del|rm BLOCK
:: Deletes the specified drop rule. Note that this may change the ID of another existing drop rule. (Abbreviation:dfrm
)dropfactory save
:: Saves the config. Use after adding rules if you've chosen to disable auto-saving. (Abbreviation:dfs
)dropfactory swap|move|mv BLOCK INDEX1 INDEX2
:: Use this to alter the order of rules for a given block. The rules with the given indices (use - to indicate the first rule with no indices) will exchange places. For example,/dfmv GRASS - 1
will swap theGRASS
andGRASS~1
rules. (Abbreviation:dfmv
)dropfactory add [BLOCK] [TOOL]
:: Use this to add new drop rules. You can optionally specify the block and the tool type; if you specify the block, you can also include an index (egGRASS~3
), which will cause that rule to be overwritten if it already exists. Once you've executed the command, DropFactory will start asking you for more information to create the drop rule, which you can just enter normally into chat (no commands, just chat text). You can cancel at any time. Once done, DropFactory will print a summary of the rule that was added.
The original dropfactory
command (abbreviated df
) can still be used to add drop rules, but it probably won't be updated to support newer things as I add them. The syntax is a little complex, but I think it's fairly intuitive; the most basic form is df BLOCK TOOL -> DROP
. Exactly what these parts are will be explained in the next section.
- Full syntax:
dropfactory BLOCK [param=value] TOOL -> DROP [enchantment=value]
Rule IDs
The ID of a rule is a block name from the Bukkit Material or CreatureType enum, with a number optionally appended. Rules are processed in order, starting from the one with no number appended and then moving on to 0, 1, 2, etc, until the next number is not found. This means that if there are gaps in the numbering, some rules will be ignored. The number, if present, is separated from the block or creature by a tilde, so if you had three drops for grass they'd be GRASS
, GRASS~0
, and GRASS~1
.
In addition to block names from the Material enum, the following item names from the same enum are permitted: MINECART
, POWERED_MINECART
, STORAGE_MINECART
, BOAT
, PAINTING
, and FISH
(the last only works if the tool is FISHING_ROD
, though).
Tools
A tool is specified as one of the following special keywords, some of which require additional information following them:
AXE
:: Must also specify the material and may optionally specify an enchantment type.PICK
:: Must also specify the material and may optionally specify an enchantment type.SHOVEL
:: Must also specify the material and may optionally specify an enchantment type.HOE
:: Must also specify the material and may optionally specify an enchantment type.SWORD
:: Must also specify the material and may optionally specify an enchantment type.SHEARS
:: This is triggered when right-clicking certain creatures with shears; sheep (with wool only), pigs (with saddle only), powered creepers, mooshrooms, and snowmen are currently supported. If you want a drop when mining with shears, useITEM
.FISHING_ROD
:: This is triggered when reeling in a fishing rod. The target may be any creature; it can also beWATER
to trigger on an unsuccessful attempt, andFISH
to trigger only when you successfully catch a fish. If you want a drop when mining with a fishing rod, useITEM
.BOW
:: This is triggered when killing a creature by firing a bow at it. If you want a drop when mining with a bow, useITEM
.FIREBALL
,SNOWBALL
,EGG
,POTION
:: These are triggered when killing a creature by throwing things at it. This does mean that some of these can't trigger in all situations. For example, a tool ofSNOWBALL
will never trigger for most mobs since they are not damaged by snowballs, but it can trigger for blazes, which are vulnerable to snowballs. A tool ofPOTION
most likely can only be triggered by throwing potions of harming, not just any potion; it might also work with potions of poison (I haven't tested this). If you want a drop when mining with an item that's normally a projectile, useITEM
.ITEM
:: Use this to specify any item as a tool; you need to specify which item (as a Material enum constant) and optionally a required data value. If you don't specify a data value it'll match any data. If you specify an axe, pickaxe, shovel, hoe, or sword here, I'm fairly sure it won't be matched; this is a small oversight which I'd like to correct at some point.NONE
:: Requires that your hands are empty for the drop to occur.ANY
:: Bypasses the check for what tool you're using.
Materials are one of GOLD
, WOOD
, STONE
, IRON
, DIAMOND
, ANY
; most of them imply "this material or better", but gold is excluded from this ranking and instead implies only gold; that's why there is an option of any.
Enchantments on tools are either FORTUNE
with a number from 1-3 (eg FORTUNE2
), which implies the Fortune enchantment (at the specified level or higher) when used on tools and the Looting enchantment (at the specified level or higher) when used on swords, or SILK
, which of course implies the Silk Touch enchantment. You can also use SILKPLUS
or FORTUNEPLUS
for higher levels of these enchantments, though there's no way to specify an exact level beyond the norm.
In the config file, the tool is specified as the tool
parameter, with subparameters tool
, material
, magic
, id
, and data
(the latter two apply to ITEM
only). There will also be an "==
" subparameter in the sample config; don't modify or remove this, and be sure to copy it to any rules you make yourself.
Drops
Drops are specified as a Material enum constant. You can also optionally specify an amount and a datavalue; when using the commands, the amount must come before the data, which means if you want data you need to specify an amount. Amount defaults to 1 while data defaults to 0. You can also specify enchantments using the syntax enchantment=level
, using an Enchantment enum constant. These can appear anywhere after the arrow in the commands, even mixed in with the other info.
In the config, the drop is specified as the drop
parameter, with subparameters id
, damage
, amount
, and meta
which has an enchants
subparameter; under the enchants you use the enchantment names as parameters and their levels as values. There will also be some "==
" subparameters and a meta-type
subparameter in the sample config; don't modify or remove these, and be sure to copy them to any rules you make yourself. For some items you might need a different value for meta-type
than the usual; if in doubt, use the in-game command to add the drop, as this will automatically pick the correct value. (Though advanced meta for most items is not yet supported by the add command, the in-game command should at least properly set it to a default base value that could then be edited further in the config file.)
Parameters
There are a number of auxiliary parameters which you can specify on a drop rule; if using the commands, they must appear before the arrow in the form param=value
, and if you're editing the config they should be indented to the same level as the tool and drop parameters. The following parameters are recognized:
shear
:: If set to false on a drop rule with SHEARS as the tool, the creature will not be sheared. Shearing a creature for the most part means reverting it to its natural state; sheep will lose their wool, pigs will lose their saddles, creepers will lose their electrical armour, and mooshrooms will turn into normal cows. (Note that the SHEARS drop won't trigger at all if these conditions are already met.) Snowmen when sheared will simply disappear.type
:: This parameter applies a finer filter on the block matching. For example, if you only want a drop to trigger for birch logs, you would make aLOG
rule with type set toBIRCH
. Details of what types can apply to what blocks or creatures is in the next section.chance
:: The percentage chance of the drop occurring. If the roll fails, it is as if the drop didn't match; ie nothing whatsoever happens.override
:: If set to true, the default drop will be overridden. On a creature drop, this will also override any prior matched rules. On a non-creature drop it may sometimes override following rules that would otherwise match; this has not been verified through testing. Currently it has no effect on FISHING_ROD or SHEARS rules.xp
:: If you want the rule to drop an experience orb as well as an item, specify the amount of experience here. It's probable that you can't currently have a rule that drops only experience and no items; this has not been tested.
Block and Creature Types
The following blocks and creatures have subtypes that you can specify in the type parameter (this list is not comprehensive):
SAPLING
,LOG
, andLEAVES
:: You can specify a tree species (one ofGENERIC
,REDWOOD
,BIRCH
).LONG_GRASS
:: You can specify a grass species (one ofDEAD
,NORMAL
,FERN_LIKE
).STEP
,DOUBLE_STEP
:: You can specify the step material (one ofSTONE
,SANDSTONE
,WOOD
,COBBLESTONE
,BRICK
,SMOOTH_BRICK
).MOB_SPAWNER
:: You can specify the mob it spawns (use a CreatureType enum constant).SNOW
:: You can specify the height (an integer from 0 to 7). This is untested.SMOOTH_BRICK
:: You can specify the type (one ofSTONE
,MOSSY_COBBLESTONE
,COBBLESTONE
).HUGE_MUSHROOM_1
,HUGE_MUSHROOM_2
:: You can specify eitherCAP
orSTEM
.WOOL
,SHEEP
:: You can specify a colour (use a DyeColor enum constant).CREEPER
:: You can specifyPOWERED
orUNPOWERED
.ENDERMAN
:: You can specify what it's carrying (use a Material enum constant).SLIME
,MAGMA_CUBE
:: You can specify the size (an integer, usually between 1 and 3 though larger numbers are possible). It'll match any slime larger than or equal to the specified size, so if you specify size 2 slimes it'll also match size 3 and 4 (and larger) slimes.PIG
:: You can specifySADDLED
orUNSADDLED
.
Note
I made this because OtherDrops was getting a bit too complicated for my liking. If you have a bug to report, by all means do so, and I'll probably fix it; however, if you want to request new features, I'm probably going to suggest that you use OtherDrops instead. This is a simple plugin for people who don't need the immense power of OtherDrops, yet still want powerful abilities to customize what items things drop.
I need to clarify something, Does it matter if my server is 1.7.9 for the 1.7.2 Version to work?
Edit: Sorry, I just want this for my server but it is 1.7.9. I asked my friend about it. Thanks for doing a good job, and I am looking forward to the update
Edit: Hey, I am trying to make an item drop that has unbreaking 10 on it for certain purposes, such as a flower pot with unbreaking 10. It says this is an invalid enchantment.
It's rather buggy, do you ever intend to continue it?
NICE plugin i'll will try on my servers, can someone pastebin sample configuration or can you give us 3 or more sample full working configuration ? :P
@Celtic_Minstrel:
Cool! I've been looking for a recently updated version of a plugin that would affect drops from blocks and mobs. Thank you very much for creating this and I can't wait to see the update!
I dunno if anyone actually wants to use this, but I have an update ready to be uploaded as soon as I get around to testing it. So... probably sometime this week?
I don't know of any reason for it not to still work, but I haven't tested it or paid a lot of attention to whether there have been breaking changes recently.
Does this still work? OtherDrops dev build site is down and there is a bad bug with TNT there atm. I really only need simple functionality as well.
How would I make white sheeps and black sheeps drop different items when sheared? I don't want when they're killed but when you shear them
@Matthieu_S
Hm... list of items might only be possible by duplicating the entire drop rule... which is highly inefficient... I'll look into this sometime. I'm not sure what you mean by a quantity key.
@Jemrada
I'm not really sure what you're missing; you could instead try adding the drop rule from in-game using commands? Even just add a generic "leaves drop saplings" rule and then edit the config to tweak it to your liking. You've obviously not gotten the itemstack format right; looking at it, it almost looks like you missed the itemstack info entirely.
Hello,
I am wanting to control the leaves drop rate of saplings. I tried the following and it doesn't work. What am I missing?
LEAVES: drop:
: org.bukkit.inventory.ItemStack
type: GENERIC chance: 10 override: true
Any help will be appreciated.
I also get this error in console
Works well in bukkit 1.5.1 I just don't quite understande how to make a list of items (tried to duplicate the entry and change the dropped item, tried to use a list using [a,b,c] and i tried a few things without any other possibility than a single dropped item) I also failed to use the quantity parameter itself... Otherwise, simple formulas are well tolerated by bukkit Also i'd like to contribute around and help documenting the plugin and make generic presets to share with the community.
I haven't checked whether this still works in the latest Bukkit builds; I wouldn't be particularly surprised if they broke something.
@CosmicVoyager
It's supposed to be able to do this.
@osamabinbulli
There doesn't seem to be source anywhere, unless I included it in the jar?
It is not clear to me if this can be use to catch other items when fishing. Can it?
Thanks, this is exactly what I was looking for. Works perfectly on Bukkit 1.2.5-R3.0.
Is there a source download somewhere? (and if not, could you please publish the sources? I'd like to know what's happening behind the scenes :-))
This looks very interesting, I'm going to test it out on my server soon. Thanks @Celtic_Minstrel
It's not a bad thing per se, no. However, if you want to do something fairly simple and you have a choice between a complicated tool and a simple one, which would you choose? I don't mean to imply that OtherDrops is a bad plugin or anything like that. I just wanted something simpler.
"I made this because OtherDrops was getting a bit too complicated for my liking."
Complicated is not always a bad thing, specifically in the case of drops plugins. Which is why Od is done so well.