BanItem Reloaded

BanItem is a simple powerful, lightweight & configurable per world per option ban item plugin. The main goal of the plugin is to disable specifics actions for specifics items in specifics worlds, supporting specifics permissions.
 
  • Blacklist: players will not be able to use the item, per option configurable;
  • Whitelist: (reversed blacklist) - all items & options will be blocked , you'll have to set which items is allowed with which option;
  • Per world configurable;
  • Per world per item permissions;
  • Per world per item per option permissions;
  • Support of custom items (items with specific item data/meta, like modded items, potions, egg spawners for old versions...);
  • Usefull commands;
  • Lightweight & activating only necessary listeners;
  • Developer API available;
  • Full documentation: https://banitem.andross.fr/
Options: (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;
  • 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);
Default config:
# +———————————————————————————————————————————————————+ #
# |——————————     BANITEM CONFIGURATION     ——————————| #
# |——————————————————      v3.2      —————————————————| #
# +———————————————————————————————————————————————————+ #
# |                   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
#     -> 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]
#    - 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

# 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.
 Using '*' instead of the world will include all the worlds.
Using 'options: *' will include all options.
  • banitem.bypass.<worldName>.<itemName>.<optionName>.<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.
  • banitem.command.* - access to all /banitem command (default: OP)
    • banitem.command.add
    • banitem.command.check
    • banitem.command.customitem
    • banitem.command.help
    • banitem.command.log
    • banitem.command.info
    • banitem.command.reload
  • /banitem add <options> [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 customitem:
    • /bi ci add <name> [option] [message]: to ban the current item in your hand (with metadata) for the current world. Entering no options will only save the custom items, so you can manually edit the config file;
    • /bi ci get <name>: will give you the custom item into your inventory;
    • /bi ci list: will give a list of all custom items (by name);
    • /bi ci remove <name>: to remove the item
  • /banitem help [type]will give you additional informations about the type entered: worlds, options, entities, gamemodes, inventories.
  • /banitem info - to get information about the current item in your hand (for example the material name to put in config.yml);
  • /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 - to reload config.yml;
Using custom items:
Add your custom items into config.yml to ban it. Example: /banitem customitem add myPotion
An example config.yml:
blacklist:
  world:
    myPotion:
      place: '&cYou can not use this potion in world'
--------------------------------------------------------------------
For any questions/suggestions: -> PM me here or on discord.
--------------------------------------------------------------------
If you like this plugin, please rate it and/or leave a comment! Thanks! :)
Or give me a coffee:

Comments

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

About This Project

Categories

Members

Recent Files