Item Drop Tables

Feb 3, 2019
Item Drop Tables

  • This wiki section explains how to use the custom mob/block drops system.

    Data is stored in the drops.yml file, located in the main plugin folder. Here is the default drops.yml setup:
    Code (Text):

    # You can create as many subtables as you
    # want for each monster/block/mythic mob.
    #
    # 'coef' is the subtable coefficient. If a subtable has coef=1 and
    # another subtable has coef=3, then the first subtable has 1 (his coefficient)
    # chance out of 4 (sum of all subtable coefficients) to be selected.
    # The higher the coefficient is, the higher the chance to be the selected subtable.
    #
    # When a drop table is read, a random subtable is chosen
    # among all subtables. It then reads the subtable items.
    #
    # The subtable names do not matter, just make sure every
    # subtable in a drop table has a different name.
    #
    # Subtable Item Format: [chance to drop],[min amount]-[max amount],[chance of being unidentified]
    # '50,1-3,10' means:
    #       - 50% chance of dropping
    #       - 1 to 3 items will drop
    #       - 10% chance of being unidentified (for each item)

    # Blocks Drop Tables
    # Read when a block is mined/broken by a player.
    blocks:
        DIAMOND_ORE:
            rare-diamond:
                coef: 1
                disable-silk-touch: true
                items:
                    MATERIAL:
                        RARE_DIAMOND: 100,2-3,0



    # Monsters Drop Tables
    # Read when any monster dies.
    monsters:
        BLAZE:
            fire-essence-table:
                coef: 1
                items:
                    MATERIAL:
                        fire-essence: 7,1-2,0
        ZOMBIE:
            rock-table:
                coef: 7
                items:
                    CONSUMABLE:
                        ROCK: 50,1-3,10
            coin-table:
                coef: 1
                items:
                    MISCELLANEOUS:
                        GOLD_COIN: 1,1-10,0
     

    Drop tables are split into subtables. When a drop table is read, a random subtable among all the subtables is chosen and the items from that subtable are then dropped. Having multiple subtables allows you to actually prevent two items from spawning at the same time.

    Let's say for instance you want a zombie to drop a custom iron sword or a custom leather chestplate. Since having a chance to drop both items at the same time would be to overpowered, you can split the zombie drop table into two subtables. In the first subtable, you would have your iron sword, and in the second subtable you would have the iron chestplate. This way, these two items can't spawn at the same time.


    Subtables can have different subtable coefficients. The higher the coefficient is, the higher the chance is for the subtable to be selected. Calculating the chance for a subtable to be selected is pretty easy. If, inside a drop table, the first subtable has a coefficient of 1 and the second has a coefficient of 2, the first subtable has a 1 in 3 chance of being selected. The chance for a subtable to be chosen can thus be calculated using this formula:
    Code (Text):
    chance = <subtable-coefficient> / <sum-of-all-subtable-coefficients>

    The monsters section corresponds to the items that drop whenever an entity dies. You have to specify in order:

    • MOB_NAME:
      • first-subtable:
        • coef: <subtable-coefficient>
        • items:
          • ITEM_TYPE: (not case sensitive):
            • ITEM_ID: (drop-chance),(min)-(max),(unidentified-chance)
          • ITEM_TYPE:
            • ITEM_ID: (drop-chance),(min)-(max),(unidentified-chance)
            • etc.
          • etc.
      • second-subtable:
        • coef: <subtable-coefficient>
        • items:
          • ITEM_TYPE: (not case sensitive):
            • ITEM_ID: (drop-chance),(min)-(max),(unidentified-chance)
            • etc.
          • etc.
      • etc.


    The blocks config section corresponds to the items that drop whenever a block is broken/mined by a player. Follow the same format as in the monsters section, but replace the mob name by the block type name. Block types can be found here (1.13).

    You can configurate three values for each subtable item:
    • drop-chance - The chance for your item to drop.
    • min & max - The amount of drops is chosen randomly between these two values.
    • unidentified-chance - the chance for your item to be unidentified when it drops.

    Additional subtable options:

    • disable-silk-touch - when set to true, this will prevent the subtable from dropping any item if the block was mined with a silk touch pickaxe. This prevents item duplication glitches with blocks like ores.
    Code (Text):
    blocks:
        DIAMOND_ORE:
            rare-diamond:
                coef: 1
                disable-silk-touch: true
                items:
                    MATERIAL:
                        RARE_DIAMOND: 100,2-3,0

    Making MythicMobs drop items from MMOItems
    Adding MMOItems to MM drop tables are pretty easy. Since 4.5, items created using MI can be summoned in MM drop tables using this format:
    [​IMG]

    This tells the drop table to add the sword from MMOItems called CUTLASS with a drop chance of 10% (so 0.1 in a MM drop table). You can change the amount of items you want to be dropped as if this drop was a vanilla drop. If you want the item to be
    unidentified when it is dropped, you will have to add one option within the brackets: this means that the item has a 30% chance of being unidentified when it is dropped.
    Code (Text):
    mmoitems{type=sword;id=cutlass;unidentified=30} 1 .1
  • Loading...
  • Loading...