Item

The format of items

Introduction

The item configuration format is a standardized system. Designed with versatility in mind, this format can be utilized in any context where items are needed. Common applications of this format include fishing loot, fishing rods, fishing baits, and even within market GUIs

The items within the configuration are structured around keys. Each key contains a set of parameters that determine the characteristics and behavior of the item. The given example, "common_bait", illustrates how a typical item is structured.

common_bait:
  material: paper
  display:
    name: '<b><#00BFFF>Common lures'
    lore:
      - ''
      - '<#7FFFD4>Desciption:'
      - '<gray>Made from natural ingredients, it attracts'
      - "<gray>fish in a calm and steady manner. It's the"
      - '<gray>go-to choice for those who prefer a '
      - '<gray>straightforward and reliable fishing experience.'
      - ''
      - '<#FFD700>Effects:'
      - '<gray> - Reduce fishing difficulty'
      - ''
  custom-model-data: 50001

Key:

The identifier for the item. In the provided example, the key is "common_bait".

Material: (1.17-latest)

This defines the base material or the type of the item. For "common_bait", the material is set to "paper".

  • Example:

    material: paper

Display: (1.17-latest)

This section provides the visual and descriptive aspects of the item.

  • Name: Determines the displayed name of the item. In this case, the name is "Common lures", and it's styled using color codes and text formatting.

    • Example:

    • display:
        name: '<b><#00BFFF>Simple lures'
  • Lore: This is a list of descriptive lines that provide more information about the item. Each line can be formatted and colored, similar to the name.

    • Example:

    • display:
        lore:
          - ''
          - '<#7FFFD4>Description:'
          - '<gray>Made from natural ingredients...'
          - '...'

Custom Model Data: (1.17-latest)

This parameter is used to assign a unique model data to the item. It can be especially useful when developers want to provide custom item textures or models in games.

  • Example:

    custom-model-data: 50001

Amount: (1.17-latest)

The quantity of the item that is being defined.

  • Example:

    amount: 1

Tag: (1.17-latest)

Allows the addition of a Custom Fishing tag to the item. This tag is quite important for the plugin to identify items from CustomFishing. Disabling this might cause some issues.

  • Example:

    tag: false

Unbreakable: (1.17-latest)

Dictates whether the item is unbreakable

  • Example:

    unbreakable: false

Item Flags: (1.17-1.20.4)

Lists specific flags altering the item's appearance or behavior. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html

  • Example:

    item-flags:
       - HIDE_DYE

Max Durability: (1.17-latest)

Sets the item's custom durability. This option would turn the item into a custom durability item. If you prefer the new custom durability system introduced in 1.20.5, see the components section below.

  • Example:

    max-durability: 100

Random Durability: (1.17-latest)

Decides if the item's durability is set randomly when acquired. This works for both vanilla durability and plugin's custom druability.

  • Example:

    random-durability: false

NBT: (1.17-latest)

Enables further customization using Named Binary Tags. If the tag value type is not specified, it might throw errors in some rare cases.

You can manually add the type to fix it for instance:

minecraft:custom_name: '(String) {"color":"white","italic":false,"text":"Fish Bone"}'

Available value types: (Int) (Byte) (String) (Float) (String) (Double) (Short) (Long) (UUID) (Boolean) (IntArray) (ByteArray)

  • Example:

  • nbt:
      int_value: 10
      double_value: 1.0
      byte_array: (ByteArray) [0, 1, 2]
      expression: (Int) 1 + 2 * 3 + 4
  • nbt:
      itemsadder:
        namespace: '(String) momirealms'
        id: 'rainbow_fish'
  • nbt:
      PublicBukkitValues:
        oraxen:id: alchemist

Components: (1.20.5-latest)

This is one of the most incredible updates to the plugin since 2.2.0. This section allows you to use any component type provided by Minecraft. Here are some examples to help you understand how to configure the component in CustomFishing configs. https://minecraft.wiki/w/Data_component_format#Item_format

  • Example1:

components:
  minecraft:food:
    nutrition: 4
    saturation: 1.5
    can_always_eat: true
    eat_seconds: 3
    effects:
      - effect: 
          id: minecraft:luck
          amplifier: 0
          duration: 30
        probability: 0.5
  • Example2:

components:
  minecraft:tool:
    rules:
      - blocks: "#minecraft:mineable/axe"
        speed: 300.0
        correct_for_drops: true
  • Example3: (Official custom durability system introduced in 1.20.5)

components:
  minecraft:max_damage: 100

Price: (1.17-latest)

  • Description: Determines the item's price.

    • Base: Initial price of the item.

    • Bonus: Multiplier applied based on size.

  • Example:

    price:
      base: 50
      bonus: 2.5

Stackable: (1.17-latest)

Indicates if the item can be stacked with similar items.

  • Example:

    stackable: true

Placeable: (1.17-latest)

Allows the item (Player Head) to be placed

  • Example:

    placeable: true

Head64: (1.17-latest)

Points to a base64 encoded string, generally utilized for custom player head textures. https://minecraft-heads.com/custom-heads/

  • Example:

    head64: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ1Nzk4NzA1Yjc1YjUzY2VmNzExNjE5OGFiNWQzOGNjZGY5YjM2ODYxNzg0MjdmYjcxMDg5NmI1MjMwZDQ2MyJ9fX0=

(Stored) Enchantments: (1.17-latest)

Details enchantments that are directly applied to the item.

  • Example:

    enchantments:                 <- for gears
      minecraft:sharpness: 1
    
    stored-enchantments:          <- for enchantment books
      minecraft:sharpness: 1

Random (Stored) Enchantments: (1.17-latest)

Enumerates possible enchantments that might be applied randomly upon the item's retrieval. Each potential enchantment is associated with a level and a chance of being applied.

  • Example:

    random-enchantments:
      lv3_unbreaking:
        enchant: minecraft:unbreaking
        level: 3
        chance: 0.2
      lv2_unbreaking:
        enchant: minecraft:unbreaking
        level: 2
        chance: 0.5
      lv1_unbreaking:
        enchant: minecraft:unbreaking
        level: 1
        chance: 1
    random-stored-enchantments:
      ...

(Stored) Enchantment Pool: (1.17-latest)

Enchantment pool provides the ability to control the amount of enchantments on one item instead of trying applying each configurated enchantment by probability. Plugin would not allow conflict enchantments to exist at the same time and EcoEnchants is totally compatible.

enchantment-pool:
  # max enchantments on the item
  amount:
    1: 6
    2: 3
    3: 1
  pool:
    'minecraft:unbreaking:1': 6
    'minecraft:unbreaking:2': 3
    'minecraft:unbreaking:3': 1
    'minecraft:sharpness:1': 6
    'minecraft:sharpness:2': 3
    'minecraft:sharpness:3': 1
    'minecraft:efficiency:1': 12
    'minecraft:efficiency:2': 6
    'minecraft:efficiency:3': 2

From the example, we can infer that player has 60% chance of getting 1 enchantment, 30% chance of getting 2 and 10% chance of getting 3.

amount
weight
probability

1

6

60%

2

3

30%

3

1

10%

Now we assume that player can get 2 enchantments.

First enchantment

enchantment
level
weight
probability

unbreaking

3

1

2.5%

unbreaking

2

3

7.5%

unbreaking

1

6

15%

sharpness

3

1

2.5%

sharpness

2

3

7.5%

sharpness

1

6

15%

efficiency

3

2

5%

efficiency

2

6

15%

efficiency

1

12

30%

Second enchantment (Assuming the first enchantment is sharpness)

enchantment
level
weight
probability

unbreaking

3

1

3.33%

unbreaking

2

3

10%

unbreaking

1

6

20%

sharpness

3

1

0%

sharpness

2

3

0%

sharpness

1

6

0%

efficiency

3

2

6.67%

efficiency

2

6

20%

efficiency

1

12

40%

Last updated