BanItem [1.7-1.18+] 3.3.3

Lightweight, powerful & configurable per world ban item plugin

  1. Andross
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    • 1.18
    Source Code:
    https://github.com/Andross96/BanItem
    Languages Supported:
    Configurable
    [​IMG]
    BanItem is a simple powerful, lightweight & configurable per world per action ban item plugin. The main goal of the plugin is to disable specifics actions for specifics items in specifics worlds, supporting specifics permissions.

    [​IMG]
    • Blacklist: players will not be able to use the item, per action configurable;
    • Whitelist: (reversed blacklist) - all items & actions will be blocked , you'll have to set which items is allowed with which action;
    • Per world configurable;
    • Per world per item permissions;
    • Per world per item per action permissions;
    • Support of meta items (matching the exact item with its metadata);
    • Create & filter custom items (items with specific metadata: potions, enchantments etc.);
    • Usefull commands;
    • Lightweight & activating only necessary listeners;
    • Developer API available;
    • Full documentation: https://banitem.andross.fr/
    Actions: (bannable)
    • Armorstandplace: when the player try to place the item on an armorstand; (v1.8+)
    • Armorstandtake: when the player try to take the item from an armorstand; (v1.8+)
    • Attack: when the player use left click with the item in the main hand on an entity;
    • Bookedit: when the player edits or signs a book and quill item;
    • Break: when the item is breaked;
    • Brew: when the item (potion) is brewed inside a brewing stand;
    • Click: when the player use left click with the item in the main hand;
    • Consume: when the player try to consume a food, a potion..
    • Craft: the item will not be craftable anymore;
    • Delete: when a player open & close an inventory, it will check and delete items which have this action;
    • Dispense: when an item is dispensed from a block;
    • Drop: when the item is dropped by a player;
    • Drops: when the item is dropped from a block;
    • Enchant: when the player try to enchant the item;
    • Entitydrop: when an entity dies and drop the item;
    • Entityinteract: when a player use right click with the item on an entity;
    • Fill: when a player use right click with the item on a fluid (water/lava);
    • Glide: when a player try to use (activate) an elytra; (v1.9+)
    • Hangingplace: when a player try to place a hanging entity (itemframe, painting..);
    • Hold: when a player try to hold the item in the hand;
    • Interact: when a player use right click with main hand on the placed item;
    • Inventoryclick: when a player try to click an item in an inventory;
    • Pickup: when the item is picked up;
    • Place: when the item is placed;
    • Rename: when a player try to rename the item in an anvil, or from a command;
    • Smelt: the item will not be smeltable anymore;
    • Smith: when the recipe of an item is completed inside a smithing table (MC>=1.16);
    • Swap: when the player try to swap the item in hands; (v1.9+)
    • Transfer: when the player try to transfer the item from an inventory to another;
    • Unfill: when a player try to unfill a bucket;
    • Use: when a player try to right click with the item in the hand;
    • Wear: when the player try to put the item as an armor (you'll need to use also the 'place' action);
    Code (YAML):
    # +———————————————————————————————————————————————————+ #
    # |——————————     BANITEM CONFIGURATION     ——————————| #
    # |——————————————————      v3.3      —————————————————| #
    # +———————————————————————————————————————————————————+ #
    # |                   Documentation:                  | #
    # |             https://banitem.andross.fr/           | #
    # +———————————————————————————————————————————————————+ #
    # For any bugs/suggestions: Andross#5254
    # +——————————————————————————————————————————————————————————————————————————————————————————————+
    # General Informations:
    #  - The blacklist will block the items.
    #  - The whitelist will allow only the items set.
    #    -> The 'message' key represents the message sent to players if they try to use an item which is not in whitelist
    #    -> The 'ignored' key represents all ignored actions (they will not being by default banned)
    #
    #  - Worlds can be written:
    #    -> single: 'world' ; 'world_the_end'...
    #    -> multiple: 'world, world_the_end'...
    #    -> all: '*'
    #    -> all except: '*, !world_the_end, !world_nether': all worlds, except world_the_end & world_nether
    #    -> regex starting with "#": '#world': world, world_nether, world_the_end
    #
    #  - Items can be written: (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html)
    #    -> single: 'stone' ; 'dirt'...
    #    -> multiple: 'stone, dirt'
    #    -> all: '*' (also include air [=empty hand]!)
    #    -> all except: '*, !stone' (all, except stone)
    #    -> regex starting with "#": '#_BED' will give all material which names matches '_BED'
    #
    #  - Actions can be written:
    #    -> single: 'place' ; 'break'...
    #    -> multiple: 'place, break'
    #    -> all: '*'
    #    -> all except: '*, !place' (all, except place))
    #  - Each actions can store some datas to check. They can be written, for example (except for cooldown & log):
    #    -> entity: pig, cow
    #    -> entity:
    #       - pig
    #       - cow
    #    -> entity:
    #       - pig,cow
    #
    #   - Actions data: (* is usable only for actions involving a player)
    #     -> cooldown(*): allow access to the action each X milliseconds (1 second = 1000 milliseconds)
    #       -> '{time}': in the message will display the time remaining
    #     -> entity: the entity interacted or involved in the ban
    #       -> EntityType: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html
    #     -> gamemode(*): the item is only banned if the player is in this gamemode
    #     -> inventory-from: the inventory where the item come from
    #       -> InventoryType: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html
    #     -> inventory-to: the inventory where the item goes to (same type as above)
    #     -> material: an additional item checked
    #       -> For example, in a BREAK action, this data will also check a matches with the item in the player's hand
    #       -> https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    #     -> permission(*): check if the player has the custom permission
    #     -> log(*): true/false - if players with /banitem log will receive a message for this ban
    #     -> message(*): a string or list of string to be sent if the item is banned
    #     -> region(*): worldguard region
    #     -> run(*): list of commands run when the action is banned:
    #       -> '{player}' : the player name
    #       -> '{world}' : the world name
    #       -> '{itemname}' : the item name
    #        +——————————————————————————————————————————————————————+
    #  - Actions and their possibles datas:
    #    - ARMORSTANDPLACE: when the player try to place the item on an armorstand [no specific data]
    #    - ARMORSTANDTAKE: when the player try to take the item from an armorstand [no specific data]
    #    - ATTACK: when the player use left click with the item in the main hand on an entity
    #      -> Special data: entity - the entity clicked
    #    - BOOKEDIT: when the player edits or signs a book and quill item [no specific data]
    #    - BREAK: when the item is breaked
    #      -> Special data: material - the item in the player hand
    #    - BREW: when the item (potion) is brewed inside a brewing stand [no specific data]
    #    - CLICK: when the player use left click with the item in the main hand
    #      -> Special data: material - the block clicked, if there is one
    #    - CONSUME: when the player try to consume a food [no specific data]
    #    - CRAFT: the item will not be craftable anymore [no specific data]
    #    - DELETE: when a player open & close an inventory, it will check and delete items which have this action [no specific data]
    #    - DISPENSE: when an item is dispensed from a block [no specific data]
    #    - DROP: when an item is dropped by a player [no specific data]
    #    - DROPS: when an item is dropped from a block
    #      -> Special data: material - the item in the player's hand
    #    - ENCHANT: when a player enchants the item
    #      -> Special data: enchantment - the enchantment applied to the item
    #    - ENTITYDROP: when an entity dies and drop the item
    #      -> Special data: entity - the entity type
    #    - ENTITYINTERACT: when a player use right click with the item on an entity
    #      -> Special data: entity - the entity interacted
    #    - FILL: When a player use right click with the item on a fluid (water/lava)
    #      -> Special data: material - the fluid type
    #    - GLIDE: when a player try to use (activate) an elytra [no specific data]
    #    - HANGINGPLACE: when a player try to place a hanging entity (itemframe, painting..)
    #      -> Special data: entity - the entity created by this placing
    #    - HOLD: when a player try to hold the item in the hand [no specific data]
    #    - INTERACT: when the player use right click with main hand on the placed item
    #      -> Special data: material - the item in player's hand
    #    - INVENTORYCLICK: when the player try to click an item in an inventory
    #      -> Special data: inventory-from - the inventory type clicked
    #    - PICKUP: when the item is picked up [no specific data]
    #    - PLACE: when the player try to place a block
    #      -> Special data: material - the block placed against
    #    - RENAME: when the player try to rename the item in an anvil, or from a command [no specific data]
    #    - SMELT: the item will not be smeltable anymore [no specific data]
    #    - SMITH: when the recipe of an item is completed inside a smithing table
    #    - SWAP: when the player try to swap the item in hands [no specific data]
    #    - TRANSFER: when the player try to transfer the item from an inventory to another
    #      -> Special data:
    #        -> inventory-from: the inventory where the item comes from
    #        -> inventory-to: the inventory where the item goes to
    #    - UNFILL: when a player try to unfill a bucket
    #      -> Special data: material - the block type clicked
    #    - USE: when a player try to use an item (right click with it)
    #      -> Special data: material - the block clicked, if there is one
    #    - WEAR: when the player try to put the item as an armor (you'll need to use also the 'place' action) [no specific data]
    #        +——————————————————————————————————————————————————————+
    #  - Examples:
    #    -> Simple structure:
    #      blacklist:  ##----> for blacklist
    #        world: ##----> world where the ban should apply
    #          ender_pearl: ##----> the item
    #            place: '&cYou can not use ender pearls in world.' ##----> the action with a message
    #                        +————————————————————+
    #    -> Advanced structure:
    #      blacklist:  ##----> for blacklist
    #       'world, world_the_end': ##----> worlds where the ban should apply
    #         'dirt, stone': ##----> the items
    #           'place, break': ##----> the actions, and below their datas
    #             message: ##----> a configurable (multi-line, or not) message
    #             - '&cA first message example'
    #             - '&cA second message example'
    #             gamemode: creative ##----> only applies if player is in creative
    #             log: true: ##----> players with /bi log activated will receive a message
    #             cooldown: 30000 ##----> this ban only applies each 30 seconds (players can only either break or place the items each 30 seconds)
    # +——————————————————————————————————————————————————————————————————————————————————————————————+

    # Debug modes
    debug
    :
     # Better & more detailled error messages
      errors
    : true
      # More detailled reload message
      reload
    : false
      # Colored message into the console
      colors-console
    : false

    # No permission message (for /banitem)
    no-permission
    : '&cYou do not have permission.'

    # Prefix of the plugin
    prefix
    : '&c&l[&e&lBanItem&c&l] '

    # This is used to allow others plugins to modify the behavior of the bans
    api
    :
      playerbanitemevent
    : false
      deletebanneditemevent
    : false

    # If true, the plugin will check (async) if an update is available
    check-update
    : true

    # List of actions that should have maximum listening priority
    # Giving maximum priority will force the ban item plugin to have the final word on an event
    # This is used mainly to also block other plugins events, if the action is banned
    # You can use the actions formatting ('*', 'action1, action2', '*,!break' etc.)
    priority
    : use,consume,click

    # Some configurable stuffs for actions
    actions
    :
     # The item for denied enchantment in anvil. Only for MC1.9+
      enchant
    :
        material
    : BARRIER
        displayname
    : '&cBANNED'
        lore
    :
         - '&cYou can not add this'
          - '&cenchantement.'

      # List of rename commands which a player could use to rename an item
      rename
    :
       - '/rename'

      # Block hoppers to take/give banned item from/to inventories
      # This is more resource intensive
      transfer
    :
        hoppers-block
    : false

      # Configuration for the wear action
      wear
    :
       # If the plugin have to check when a player enter or exit a WorldGuard region
        region-check
    : false
        # Scan each seconds if a player is wearing a banned item [async]
        scanner
    : true

      # The plugin will not take in consideration inventories which name is in this list
      # WITHOUT color codes & case sensitive: color codes from GUI titles will be removed to be compared
      delete
    :
        ignored-inventories-titles
    :
         - 'My Cool Gui'
          - 'Shop'

    # Hooking with plugins
    hooks
    :
      worldguard
    : false
      advancedenchantments
    : false

    # Animations when a ban item message is sent
    sound
    :
      enabled
    : true
      type
    : ENCHANT_THORNS_HIT
      volume
    : 1
      pitch
    : 1
      worldSound
    : false # if the sound can be heard by others players around or not
    particle
    : # available only on bukkit 1.9+
      enabled
    : true
      type
    : BARRIER
      amount
    : 1

    # Here is some quick examples:
    #blacklist:
    #  world:
    #    diamond_block: # can not place or break diamond_block
    #      place: '&cYou are not allowed to place a diamond block in world.'
    #      break: '&cYou are not allowed to break a diamond block in world.'
    #    gold_block: # can not place gold block if in creative mode
    #      place:
    #        gamemode: creative
    #        message: '&cYou can not place gold block while in creative mode.'
    #    my_meta_item: # meta item from /bi metaitem, useable only each minute (time in millis)
    #      attack:
    #        cooldown: 60000
    #        message: '&cYou have to wait &e{time}&c before attacking with this item again.'
    #    stick: # can not put stick into an itemframe. Sending log message to players with /bi log activated.
    #      entityinteract:
    #        entity: item_frame
    #        message: '&cYou can not put a stick into an itemframe!'
    #        log: true
    #    diamond: # can not put diamonds from a player inventory to a chest
    #      transfer:
    #        inventory-from: player
    #        inventory-to: chest
    #        message: '&cYou can not put diamonds in chests.'
    #  '*, !world_the_end': # all worlds except the end
    #    ender_pearl:
    #      use: '&cYou can use enderpearls only in the end.'
    #  # you have to set priority to 'use' (above the config) in order for this to work
    #whitelist:
    #  world_the_end:
    #    message: '&cOnly thing allowed in this world: placing dirt.'
    #    ignored: 'interact' # we ignore the interact, so player can interact (to place) with everything
    #    dirt: place # dirt can be placed
    ### Whitelist conclusion: in world_the_end, only one thing is allowed: placing dirt.
    ### Everything else (breaking, pickup, drop etc.) will be blocked.
    Code (YAML):
    blacklist:
      test
    :
        chest
    :
          interact
    : '&cYou can not open chests in world test.'
    Code (YAML):
    blacklist:
      '*'
    :
        diamond
    :
          drop
    : '&cYou can not drop diamonds while in creative mode.'
          gamemode
    : creative
    Code (YAML):
    blacklist:
      world
    :
        ender_pearl
    :
          use
    : '&cYou can not use enderpearls in world.'
    Code (YAML):
    blacklist:
      world
    :
        diamond
    :
          '*'
    : '&cThis item is banned.'
    Code (YAML):
    blacklist:
      '*, !world_the_end'
    :
        diamond
    :
          '*, !drop'
    : '&cThis item is banned, but you can still drop it. Does not apply in the ender.'
    Code (YAML):
    whitelist:
      world_the_end
    :
        message
    : '&cYou can only break and place end stones in the end.'
        ender_stone
    : place, interact, break

    [​IMG]
    The permissions are very powerful & accurate, to fit for the exact world, item, action & data needed. They should be respected carefully.

    Bypass permissions, used to bypass the banned items from config:
    • banitem.bypass.<worldName>.<itemName>.<actionName>.<dataName>
      • include all worlds with allworlds.
        • Example: banitem.bypass.allworlds.stone.place.* -> Allow player to place stone in all worlds, no matter on what block the stone is placed.
      • include all items with allitems
    • banitem.bypass.*
    • banitem.bypass.allworlds.allitems
    • banitem.bypass.worldName.allitems
    Commands permissions:
    • banitem.command.add
    • banitem.command.check
    • banitem.command.help
    • banitem.command.info
    • banitem.command.load
    • banitem.command.log
    • banitem.command.metaitem
    • banitem.command.reload
    • banitem.command.remove
    [​IMG]
    • /banitem add <actions> [-m materials] [-w worlds] [message]: to ban the current item in your hand (without metadata) for the current world;
    • /banitem check [delete] - will give a list of all players which inventories contains a blacklisted item (respects the worlds). Use the 'delete' argument to also delete those items;
    • /banitem metaitem:
      • /bi mi add <name> [action] [message]: to ban the current item in your hand (with metadata) for the current world. Entering no actions will only save the meta items, so you can manually edit the config file;
      • /bi mi get <name>: will give you the meta item into your inventory;
      • /bi mi list: will give a list of all meta items (by name);
      • /bi mi remove <name>: to remove the item;
    • /banitem help [type]: will give you additional informations about the type entered: worlds, actions, entities, gamemodes, inventories.
    • /banitem info [debug]: to get information about the current item in your hand (for example the material name to put in config.yml);
    • /banitem load <filename>: load a specific configuration file;
    • /banitem log: will activate the log mode. Players with log mode activated will receive a message in game for all banned items with data 'log: true';
    • /banitem reload/rl: to reload config.yml;
    • /banitem remove [-m materials] [-w worlds]: remove/unban the item in your hand;

    1. You have to create the custom item in customitems.yml:
    Code (YAML):
    customItemName:
      material
    : DIAMOND_SWORD
      enchantment-contains
    : 'unbreaking:3'
    The custom item created, you'll can add it into the blacklist (config.yml) with name 'customItemName':
    2. Add the custom item into the blacklist (config.yml)
    Code (YAML):
    blacklist:
        world
    :
         customItemName
    :
          attack
    : '&cYou can not attack with this sword.'
    Thats it! Players will not be able to attack with any diamond sword which have enchantment unbreaking 3.

    Important note: the ban item database is loaded on next available server tick, to let others plugins (worlds plugins, items plugins etc.) correctly load their things first.

    API class: BanItemAPI

    Using the BanItem api directly on plugin load will then give you an empty database. Load them into a delayed task within 2/3 seconds.

    Code (Java):
    // Get the BanItemAPI: the correct way:
    final BanItem banItem = (BanItem) getServer().getPluginManager().getPlugin("BanItem");
    final BanItemAPI banItemApi = banItem.getApi();
    // or
    // Get the BanItemAPI directly from the API instance:
    final BanItemAPI banItemApi = BanItemAPI.getInstance();
    // or
    // Get the BanItemAPI from BanItem instance:
    final BanItemAPI banItemApi = BanItem.getInstance().getApi();
    PlayerBanItemEvent: when an item/action should be banned, cancellable;
    DeleteBannedItemEvent: when an item should be deleted by the delete action, cancellable;

    Special thanks to donators:
    Again, complete documentation here!

    [​IMG]
    For any bugs/questions/suggestions -> PM me here or on discord (Andross#5254).
    If you like this plugin, please rate it and/or leave a comment! Thanks! :)
    Or give me a coffee:
    [​IMG]

Recent Reviews

  1. Sheimoxx_
    Sheimoxx_
    1/5,
    Version: 3.3.3
    terrible, I couldn't ban the hopper cart, it tells me that it is already on the blacklist, but it can continue to be placed, crafted, etc.
  2. Ditlevvg
    Ditlevvg
    5/5,
    Version: 3.3.3
    Nice plugin, works like a charm. had a bit of a problem with the permissions but when figured it out it worked just fine
  3. Ratchet_97
    Ratchet_97
    5/5,
    Version: 3.3.3
    5 stars with no doubt. Works as intended, has lots of functions, creator is quick to respond, simply epic.
  4. Sharkoff
    Sharkoff
    5/5,
    Version: 3.3.3
    Fast support, excellent plugin. It helps alot and does everything i want. Thanks.
  5. Thin_Troll
    Thin_Troll
    3/5,
    Version: 3.3.3
    Funnel check not working.
    I have this config, but I can move it through the funnel to the chest without any problems.
    I tried to prevent the shulker from falling out when breaking the chest, but this also failed.

    https://paste.ee/p/cohaX
  6. xR4Z3R
    xR4Z3R
    5/5,
    Version: 3.3.3
    Great plugin, has so many options to ban certain items (even with metadata) and every action possible to imagine - must have for your server if you want to keep players away from doing something you don't want them to. Keeps shady business away ;D
  7. Bamboos2333
    Bamboos2333
    5/5,
    Version: 3.3.3
    Best plugin ever! But I just want to know that how can I let an item,like bedrock or something cannot drop into the hopper and minecart with hopper?(Not I put them into hopper. It is that it drops(falls) into the hopper) My english is not good,thanks.
  8. rellun
    rellun
    5/5,
    Version: 3.3.3
    Can anyone tell me how to use this to ban mending book completly.

    i really want mending blocked both from books and item use
  9. Hamsterliebe
    Hamsterliebe
    5/5,
    Version: 3.3.3
    This Plugin is better then Creative Item Controll...
    1st Reason: It works fine!
    2nd Reason: You can ban every Item you want and can bypass every Item with Permissions too! NICE!

    Great Work! Thanks for making this Plugin Free!
  10. rellun
    rellun
    5/5,
    Version: 3.3.2
    how do i ban an enchant both in the etable and in book
    great plugin love it . gonna help us a lot