V-AntiDrop prevents accidental dropping of items, useful for servers that have special or even valuable items, avoiding losing them.
[1] Prevent accidentally dropping items in two ways, the
drop-type: never that you can never drop the item and the
drop-type: confirmation in which you have to press the key twice to drop the item.
[2] The plugin allows you to deny the dropping of custom items, as well as vanilla items.
Custom Items: In custom items the Name, Lore and Enchantments are detected, and if your item doesn't contain any of these elements, you can set the conditional as ignore.
Code (YAML):
Example1:
drop-type: never
item: COAL
data: 0
name-conditional: equals
lore-conditional: equals
enchants-conditional: contains
name: '&b&lCogin'
lore: - '&r'
- '&bExample'
- '&r'
enchants: - DAMAGE_ALL-3
message: '&8
[&bV-AntiDrop&8
] &7You can''t drop your Cogin.'
drop-when-die: false
Example2:
drop-type: confirmation
item: DIAMOND
data: 0
name-conditional: equals
lore-conditional: contains
enchants-conditional: contains
name: '&e&lFang'
lore: - '&r'
- '&eExample'
- '&r'
enchants: - DAMAGE_ALL-3
message-confirmation: '&8
[&bV-AntiDrop&8
] &cPress the key again to drop your
fang'
message-confirmed: '&8
[&bV-AntiDrop&8
] &aYou dropped your fang.'
drop-when-die: false
Example3:
drop-type: never
item: IRON_PICKAXE
data: 0
name-conditional: equals
lore-conditional: contains-lines
enchants-conditional: ignore
name: '&e&lGuno Pickaxe'
lore: - '&7Get &eX2 &7diamonds when mining'
- '&7to get money.'
enchants: - DIG_SPEED-5
- LOOT_BONUS_BLOCKS-3
- DURABILITY-3
message: '&8
[&bV-AntiDrop&8
] &7You can''t drop your &e&lGuno Pickaxe.'
drop-when-die: false
equals: Detects that the lore of the item is exactly the lore registered in the Config.
Code (YAML):
lore-conditional: equals
lore: - '&r'
- '&7Get &eX2 &7diamonds when mining'
- '&7using this pickaxe and a chance'
- '&7to get money.'
- '&r'
- '&eMoney Chance: &71%' - ''
contains: Checks that the lore of the item contains the lines that are in the Config, in the same order as it is found, ignoring the other lines of the item.
Code (YAML):
lore-conditional: contains
lore: - '&7Get &eX2 &7diamonds when mining'
- '&7using this pickaxe and a chance'
- '&7to get money.'
contains-lines: This conditional checks each line in lore in the Config separately. Here it does not matter the order of lore in Config. It is not necessary that the lore in Config has all the words of the line of the item. (Ex. If the item has a line of its lore like "This pickaxe give you X2 diamonds" and in the Config you registered that it detects "This pickaxe give" the item will not be dropped because it contains some words of the lore of the item).
Code (YAML):
lore-conditional: contains-lines
lore: - '&7Get &eX2 &7diamonds when mining'
- '&7to get money.'
Vanilla Items: In vanilla items the dropping of any item that is of the same material is denied, regardless of the name, lore and enchantments.
Code (YAML):
Example3:
drop-type: never
item: DIAMOND_PICKAXE
data: 0
message: '&8
[&bAnti-Drop&8
] &7You can''t drop your pickaxe.'
drop-when-die: false
[3] It has custom messages for each item and if you don't want it to have a message just set the message to "ignore".
Code (YAML):
Never drop:
message: '&8
[&bAnti-Drop&8
] &7You can''t drop your Cogin.'
Drop confirmation:
message-confirmation: '&8
[&bAnti-Drop&8
] &cPress the key again to drop your axe'
message-confirmed: '&8
[&bAnti-Drop&8
] &aYou dropped your axe.'
Ignore message:
message: ignore
message-confirmation: ignore
message-confirmed: ignore
[4] Avoid losing the item on death by having the drop-when-die option set to false, this option can be set for each item added. If you want to drop it, set it to true. drop-when-die-type allows you to set two types of ways to recover items on death: 1. Recover all items (drop-when-die-type: all;100) 2. Recover half of the items (drop-when-die-type: half;100)
You will be able to set a probability of being able to recover items depending on the probability set, this option is found in drop-when-die-type, next to the type of item recovery on death separated by a ; (Example: all;100).
Examples: 1. Half items: If you have a probability of 50%, then you have a 50% chance of recovering half of the items in a stack.
Code (Text):
drop-when-die-type: half;50
2. All items: If you have a 50% chance, then you have a 50% chance of recovering the entire stack of items.
Code (Text):
drop-when-die-type: all;50
[5] If you want to prevent items from being dropped in a certain
world or
region of WorldGuard, this option will allow you to do that by setting the
locations option to
true and adding your locations where you don't want them to be dropped to the
location-list.
Requirements:
- Plugins WorldGuard and PlaceholderAPI (Not required for the plugin to work)
- Have WorldGuard extension in PlaceholderAPI for the regions option to work.
>
How can I add it? With the command /papi ecloud download WorldGuard.