Custom Items - BoBoBalloon/InnovativeItemsDOCS GitHub Wiki

Intro

In this section, you will learn how to build custom items for the Innovative Items plugin.

Name & Material

Now let's get started. All items must have a name and a material, without them, the item will fail to load. An example is provided below:

blood-blade:
  material: 'DIAMOND_SWORD'

This will create a custom item by the name of blood-blade with the material value of a diamond sword, a list of all valid materials can be found here

Display Name & Lore

But this is not all you can do, you can also make a display name and lore to make your item look pretty:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'

As shown above you set the display name using the display-name field and set the item lore using the lore field

These fields also support color codes as shown above, you can find all the color codes here

In the premium version of the plugin, these fields also support hex color codes, an example for the color black would be &#000000test

Enchantments

On top of that there is also support for enchantments, let's say we wanted to give the blood blade item sharpness 150, that would be as easy as this:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150

Now under the enchantments field, "DAMAGE_ALL" is listed, instead of sharpness. This is because the internal names for enchantments doesn't match their display names. A list of all enchantments and their internal names can be found here

Item Flags

Another field that this plugin supports is item flags. Item flags can be used to hide enchantment displays, hide leather armor dye, and much more. They make items look a lot more appealing. For example, if we wanted to hide the "Sharpness 150" text in the item lore and hide attributes from the item lore (attributes will be discussed later), we could do this:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'

A list of all valid item flags and their usage can be found here

Attributes

Another feature provided by this plugin is support for attributes. Attributes can be used to change and set basic values for this item and the player using it. This plugin handles attributes in an interesting way. This is because buffs (or debuffs) given by attributes are on an equipment slot basis, which means it would have a different effect when held in your main hand slot vs. your chestplate slot. This is useful if you want to make armor that buffs the users damage but you don't want it to buff their damage when held in their hand. An example of attributes is provided below:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

This example would make it so when a player was holding the blood blade in their main hand, the base value of their max health would increase by 520 (because the ANY field is in addition to, not in place of) and the base value of their movement speed would increase by 50. A list of MOST valid equipment slots can be found here (keep in mind that ANY is also a valid option, it just does not appear on the provided list). A list of valid attributes can be found here. Due to the limit of an 8-bit integer, the maximum attributes that can be applied to an item without risking overflow is 256.

Custom Model Data

In addition, there is support for custom model data in case you have your players using a custom texture pack, an example can be found here:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987 #LOOK HERE!!!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

The example above has the custom-model-data field, this would set the custom model data of the blood blade item to 987.

Unbreakable

Additionally, we also provide support for making items unbreakable, an example can be found here:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true #LOOK HERE!!!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

The example above shows how to use the unbreakable field to make an item unbreakable, if you want your item to not be unbreakable, there is no need to include this field as all items have this field set to false by default.

Placeable

In minecraft, some items are capable of being placed on the ground as a block, but as a server owner, this function may be unwanted. Because of this, we provide support to prevent custom items being placed on the ground as a block.

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true
  placeable: false #LOOK HERE!!!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

In this example with the blood-blade item, the placeable field would have no affect. This is because the material DIAMOND_SWORD is not a block that can be placed on the ground. But if the material was DIRT, this would prevent it from being placed. This field is set to false by default.

Soulbound

In minecraft, when you die, you lose all of your items. With the soulbound field set to true, the item will be given back to the player when they respawn and will not drop the item on death.

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true
  placeable: false
  soulbound: true #LOOK HERE!!!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

The example above shows how to use the soulbound field to make an item not dropped on death, if you want your item to not be soulbound, there is no need to include this field as all items have this field set to false by default. This field has no affect if the gamerule keep-inventory is set to true. Also please keep in mind that items saved on death are only stored in memory meaning if a player were to die with a soulbound item and quit the game and the server restarted before they respawned, the next time they log back in their soulbound items would be lost.

Wearable

Sometimes you will create some custom items that by default are able to be worn by a player (e.g. player skulls). If you for whatever reason decide this functionality interferes with the custom item you can control if the item is able to be used that way with the wearable field.

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true
  placeable: false
  soulbound: true
  wearable: false #LOOK HERE!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

In this example with the blood-blade item, the wearable field would have no effect. This is because the material DIAMOND_SWORD is not a material that can be worn by a player. But if the material was DIAMOND_HELMET, this would prevent it from being worn on the player's head, except when the player is in creative mode. This field is set to true by default.

Custom Durability

There may be an item you create that would be quite strong, so you would like to restrict its usage. In this case, you can set the maximum durability of any item you want, it may be higher or lower than the original, but not less than one.

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true
  placeable: false
  soulbound: true
  max-durability: 10 #LOOK HERE!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

In this example, the blood-blade item, would be able to be used ten times before the item is destroyed.

Update Item (Garbage Collector)

The Garbage Collector is a very unique system that boasts one of the most powerful features this plugin has to offer, consistency. Of course, this does come with drawbacks, for example, if you were to enchant an item, the garbage collector would not be able to differentiate a change a player made and a change you made in your configuration files. If you wish for your players to modify enchantments or any other item data for a custom item, you can disable the garbage collectors update feature for a specific item instead of disabling it completely for all items.

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  custom-model-data: 987
  unbreakable: true
  placeable: false
  soulbound: true
  max-durability: 10
  update-item: false # LOOK HERE!
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

This comes with the obvious drawback that changes to this item would not be reflected in older versions of the item in the game, but this is an efficient way of allowing players to treat custom items as more traditional items. If the update-item field is not provided, this value will be set to true by default.

Ability

Lastly, we provide support for linking custom abilities written by you, to be linked to the items you create, an example can be found here:

blood-blade:
  material: 'DIAMOND_SWORD'
  display-name: '&4&lBlood Blade'
  ability: 'lifesteal' #LOOK HERE!!!
  custom-model-data: 987
  unbreakable: true
  placeable: false
  soulbound: true
  wearable: false
  lore:
    - ''
    - '&7&oA blade made of the blood of the &4&ogod of war&7&o...'
    - '&7&oLegend says that it was from a paper cut'
  enchantments:
    DAMAGE_ALL: 150
  flags:
    - 'HIDE_ENCHANTS'
    - 'HIDE_ATTRIBUTES'
  attributes:
    ANY:
      GENERIC_MAX_HEALTH: 20
    HAND:
      GENERIC_MAX_HEALTH: 500
      GENERIC_MOVEMENT_SPEED: 50

The example above would link the ability by the name of lifesteal to the blood blade item.

If you intend to make an item specific ability that has no need to be referenced elsewhere and you own the premium version of the plugin, it is recommended to make an anonymous ability instead. You can read more about anonymous abilities here.

Final Thoughts

Keep in mind not all these values are required. The only required value is the material field and the name field, as long as those are present, the item will load.

If you feel like you have a pretty good understanding of how generic items are loaded, maybe take a peek at the advanced section.