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 the GRASS and GRASS~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 (eg GRASS~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, use ITEM.
  • FISHING_ROD :: This is triggered when reeling in a fishing rod. The target may be any creature; it can also be WATER to trigger on an unsuccessful attempt, and FISH to trigger only when you successfully catch a fish. If you want a drop when mining with a fishing rod, use ITEM.
  • BOW :: This is triggered when killing a creature by firing a bow at it. If you want a drop when mining with a bow, use ITEM.
  • 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 of SNOWBALL 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 of POTION 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, use ITEM.
  • 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 a LOG rule with type set to BIRCH. 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, and LEAVES :: You can specify a tree species (one of GENERIC, REDWOOD, BIRCH).
  • LONG_GRASS :: You can specify a grass species (one of DEAD, NORMAL, FERN_LIKE).
  • STEP, DOUBLE_STEP :: You can specify the step material (one of STONE, 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 of STONE, MOSSY_COBBLESTONE, COBBLESTONE).
  • HUGE_MUSHROOM_1, HUGE_MUSHROOM_2 :: You can specify either CAP or STEM.
  • WOOL, SHEEP :: You can specify a colour (use a DyeColor enum constant).
  • CREEPER :: You can specify POWERED or UNPOWERED.
  • 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 specify SADDLED or UNSADDLED.

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.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    36611
  • Created
    Feb 14, 2012
  • Last Released File
    Mar 2, 2014
  • Total Downloads
    2,741
  • License

Categories

Members

Recent Files

Bukkit