Blocked items

Information about how to block items from being repaired.

Definition

Blocked items can be defined in a list under blocked-items in the config. The available attributes for item matching are type, name, lore, enchantments, flags and the unbreakable state. With all attributes specified, a blocked item's specification can look like this:

- type: "DIAMOND_PICKAXE"
  name: "&bThe ultimate pickaxe"
  lore:
  - "&oThis item cannot be repaired."
  enchantments:
  - "DURABILITY:3"
  flags: []
  unbreakable: false

Attribute matching

For an item to be considered blocked, it has to match all attributes of any of the blocked items defined in the config. That means that a vanilla diamond pickaxe with no enchantments will not be blocked by:

- type: "DIAMOND_PICKAXE"
  enchantments:
  - "DURABILITY:3"

...because it matches the type, but it does not match the enchantments attribute, as it is not enchanted. However, with the following configuration:

- type: "DIAMOND_PICKAXE"

All diamond pickaxes will be blocked (including the one without enchantments), as all of them match the attributes defined - they are all diamond pickaxes.

Enchantments and flags

Please note that there is a difference between:

- type: "BOW"
  enchantments: []

and

- type: "BOW"

While the first example will only match bows with no enchantments, the latter will match all bows, no matter their enchantments. The same principle applies to flags.

Attributes

Type

A string, defines the item's type. All values are available at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html (for the latest server version, lookup a similar list for the version you are running).

Name

A string, defined the item's name. Allows the use of color codes.

Lore

A list of strings, defines the item's lore. Each line of the lore allows the use of color codes.

Enchantments

A list of strings in format "enchantment:level". enchantment must be one of the constants available at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html (for the latest server version, lookup a similar list for the version you are running).

For enchantments which do not have levels, specify the level as 1. To match an enchantment at any level, specify it as ?.

Order of the given list does not matter.

Flags

A list of strings. A flag must be one of the constants available at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/ItemFlag.html (for the latest server version, lookup a similar list for the version you are running).

Order of the given list does not matter.

Unbreakable

A boolean, defines the item's unbreakable state. This is not the "Unbreaking" enchantment, rather this refers to a state items can have and which can be manipulated exclusively by the server software (including plugins).

Last updated