1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script AdvDropTables 1.0

A config based drop table script.

  1. Revelationage
    Contributors:
    Revelationage, AsuDev
    Supported Minecraft Versions:
    • 1.12
    300.png
    What is this script?
    AdvDropTables is a script that allows you to create complex drop tables. A drop table is a list of items or tables that contain items that are given to the player by chance when killing an entity (or executing other events).

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Features
    - Create Drop Tables
    - Add Sub Tables to your drop tables
    - Everything is based in .yml (config)
    - Create links between mobs and drop tables (by display name)
    - Lots of different options for drop tables / sub tables (see below)
    - Change config options in game
    - 90% messages are editable in config. The placeholders are below the command section

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Commands

    General Drop Table Commands:
    - /dt [<help>] - Help for all drop table related commands. - dt.help
    - /dt create <table> - Creates a drop table. - dt.create
    - /dt remove <table> - Deletes a drop table. - dt.remove
    - /dt list - List of all created drop tables. - dt.list
    - /dt toggle <table> - Toggle enable or disabled a drop table. - dt.toggle
    - /dt viewdt <table> - Info on the specified drop table and its sub tables - dt.viewdt

    Sub Table Commands:
    - /dt addsub <table> <sub name> - Create a sub table for a drop table. - dt.addsub
    - /dt removesub <table> <sub name> - Removes a sub table from a drop table. - dt.removesub
    - /dt listsubs <table> - Lists all sub tables for specified drop table - dt.listsubs
    - /dt subdisplay <table> <sub> <display> - Set the display for a sub table - dt.subdisplay
    - /dt subrarity <table> <sub> <number> - Set the rarity of a sub table - dt.subrarity
    - /dt subproclimit <table> <sub> <number> - Set the proc limit of a sub table - dt.subproclimit
    - /dt subprocrarity <table> <sub> <number> - Set the proc rarity of a sub table - dt.subprocrarity
    - /dt subdroptoggle <table> <sub> - Toggles a sub table to drop whole table or random item - dt.subdroptoggle
    - /dt subadditem <table> <sub> <drop id> - Creates a drop in a sub table with given id (held item) - dt.subadditem
    - /dt subremid <table> <sub> <drop id> - Deletes a drop in a sub table - dt.subremid
    - /dt subitemmin <table> <sub> <drop id> <int> - Sets min amount of drop - dt.subitemmin
    - /dt subitemmax <table> <sub> <drop id> <int> - Sets max amount of drop - dt.subitemmax
    - /dt subdroponfloor <table> <sub> <drop id> - Toggles drop to floor or put in inventory - dt.subdroponfloor
    - /dt subtogglebc <table> <sub> <drop id> - Toggle enable or disable drop to be broadcasted - dt.subtogglebc
    - /dt subsetbc <table> <sub> <drop id> <bc> - Set broadcast message of a drop - dt.subsetbc

    Get Table Commands:
    - /getdt <player> <table> [<amount>] - Rolls drop table for specified player - dt.getdt
    - /getsub <player> <table> <sub> [<amount>]
    - Rolls sub table for specified player - dt.getsub
    - /getid <player> <table> <sub> <id> [<amount>]
    - Rolls drop in a sub for specified player - dt.getid

    Linking Commands:
    - /createlink <link id> <table> <display name> - Create a link between a drop table and entity name - dt.createlink

    - /removelink <link id> - Remove a link completely - dt.removelink
    - /linkdetection <link id> - Toggles detection type "is" or "contains" - dt.linkdetection
    - /listlinks - List all drop table links - dt.listlinks
    - /linkdisplay <link id> <display name> - Set display name of link - dt.linkdisplay
    - /linkaddtable <link id> <table> - Adds a drop table to a link - dt.linkaddtable
    - /linkremovetable <link id> <table> - Removes a drop table from a link - dt.linkremovetable

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Message Placeholders
    Note: Some placeholders only work in certain instances. Below will show you what placeholders can be used in what message option.

    {player} - Used in IDRoll, DTRoll, SubRoll
    {created} - Used in Created
    {removed} - Used in RemovedTable
    {display} - Used in SubDisplaySet, CreateLink, LinkDisplay
    {min} - Used in SubItemMin
    {max} - Used in SubItemMax
    {amount} - Used in DTRoll, SubRoll, IDRoll

    {sub} - Used in SubCreated, SubRemoved, SubDisplaySet, SubRaritySet, SubProcLimitSet, SubProcRaritySet, SubDropToggleTrue, SubDropToggleFalse, SubAddItem, SubRemoveId, SubItemMin, SubItemMax, SubDropOnFloorTrue, SubDropOnFloorFalse, SubToggleBcTrue, SubToggleBcFalse, SubSetBc, SubRoll, IDRoll

    {dt} - Used in SubCreated, SubRemoved, SubDisplaySet, SubRaritySet, SubProcLimitSet, SubProcRaritySet, SubDropToggleTrue, SubDropToggleFalse, SubAddItem, SubRemoveId, SubItemMin, SubItemMax, SubDropOnFloorTrue, SubDropOnFloorFalse, SubToggleBcTrue, SubToggleBcFalse, SubSetBc, DTRoll, SubRoll, IDRoll, CreateLink, LinkAddTable, LinkRemoveTable, ToggleEnabled, ToggleDisabled

    {id} - Used in SubAddItem, SubRemoveId, SubItemMin, SubItemMax, SubDropOnFloorTrue, SubDropOnFloorFalse, SubToggleBcTrue, SubToggleBcFalse, SubSetBc, IDRoll, CreateLink, RemoveLink, LinkDisplay, LinkDetectionContains, LinkDetectionIs, LinkAddTable, LinkRemoveTable

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Drop Table Options

    Here is a list of config options and their functions for drop tables.

    isDropTable: 'true' #This is a detector for /dt list. If this option does not exist or is not true, the drop table will not show up in the list of drop tables. The drop table will also not function.

    isDropTableEnabled: 'true' #When set to true, this drop table can be used. If set to false, the drop table will not be used.

    Commands for these options:
    - /dt create <table>
    - /dt remove <table>
    - /dt toggle <table>

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Sub Table Options
    Here is a list of config options and their functions for sub tables.

    Display: '&bName of Sub Table' #This is the display for the sub table.

    Rarity: '5' #Rarity is the chance that this sub table will proc. Chance goes by 1/x (x being the rarity.). So if you put 5 as the rarity, it would be 1/5 or a 20% chance.

    ProcLimit: '1' #Proc limit is the amount of times this sub table can proc in one roll. So if you put this to something higher than 1, the player will have a chance to get loot from this table more than once in the same roll.

    ProcChance: '10' #Proc chance is the chance that you will proc the sub table again. This works the same as rarity, so if you put 10 as the proc chance, it would be a 1/10 or a 10% chance.

    DropWholeTable: 'false' #Drop whole table determines what loot is given to the player in the sub table. If set to 'false', it will pick a random item in the sub table to give as loot. If set to 'true', it will give every item in the sub table as loot.

    Commands for these options:
    - /dt addsub <table> <sub>
    - /dt removesub <table> <sub>
    - /dt subdisplay <table> <sub> <display>
    - /dt subrarity <table> <sub> <number>
    - /dt subproclimit <table> <sub> <number>
    - /dt subprocrarity <table> <sub> <number>
    - /dt subdroptoggle <table> <sub>

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Drops Options
    Here is a list of config options and their functions for item drops in a sub table.

    Min: '1' #Min is the minimum amount of the item that will be dropped.

    Max: '5' #Max is the maximum amount of the item that will be dropped.

    DropOnFloor: 'true' #If this option is set to 'true', the item will drop at the location of the event. If set to 'false' the loot will be put into the player's inventory. If the player's inventory is full, it will drop at location of the event.

    Broadcast: 'true' #If this option is set to 'true', The loot will be broadcast to everyone on the server.

    BroadcastMessage: '&8[&eDrops&8] &d{player} &7has received &bx{amount} {item} &7as a rare drop.' #The message that is broadcast when the player receives a drop. Option above must be set to 'true' for this to work.


    Commands for these options:
    - /dt subadditem <table> <sub> <id>
    - /subremid <table> <sub> <id>
    - /subitemmin <table> <sub> <id> <int>
    - /subitemmax <table> <sub> <id> <int>
    - /subdroponfloor <table> <sub> <id>
    - /dt subtogglebc <table> <sub> <id>
    - /dt subsetbc <table> <sub> <id> <message>

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Dependencies
    Skript dev37c (Bensku) - https://github.com/SkriptLang/Skript/releases/download/dev37c/Skript.jar
    SkUtilities 0.9.2 - https://forums.skunity.com/resources/skutilities.26/

    skript-mirror - https://forums.skunity.com/resources/skript-mirror.254/
    SkQuery 3.6.1-Lime - https://spigotmc.org/resources/unofficial-skquery-fork-1-6-1-12.36631/
    Skellett 1.9.6b - https://spigotmc.org/resources/skript-java-addon-skellett.34361/
    json.sk 2.3 - https://forums.skunity.com/resources/json-sk.23/

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    ToDo
    Economy Support? Let me know in comments.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Bugs
    Yml formatting is a bit weird for color codes (Not bug, just annoying)
    You will get a big error message on starting up the script for the first time. Just ignore it as it is harmless.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------

    Extra Info
    Contact Discord: AsuDev#0714
    Use the comments only for giving ratings. If you find a bug, need help, or want something to be added to this script, send me a pm on discord. This is my first resource so I hope you enjoy it!