Skip to content

Item Meta

Esophose edited this page Oct 21, 2021 · 44 revisions

Introduction

This is a continuation of the items section, please read that first if you haven't.

Key

Below you can find links to each type of item meta on this page:

Normal Meta

These values will apply to every item that can be dropped. All values are optional.

Value Name Type Description
amount Whole number The amount of items that will drop. See Number Providers for more info.
max-amount Whole number If amount is higher than this value, it will be set to this value.
display-name Text The name of the item, supports color codes.
lore List of text The lore of the item, supports color codes and multiple values.
custom-model-data Whole number The custom model data of an item. Used for resource packs. If you don't know what this is, you probably don't need it.
unbreakable true or false Whether or not the item can take damage. Mainly only applies to items that can take damage.
repair-cost Positive whole number The cost in levels of the next repair in an anvil. Mainly only applies to items that can be repaired.
durability A whole number or percentage The durability of the item. Mainly only applies to items that have durability. Should not be included if min-durability and max-durability are used.
min-durability and max-durability A whole number or percentage Same as durability, must include both values. Should not be included if durability is used.
hide-flags List of ItemFlag or true Allows hiding certain text in the item description. If set to true, all item flags will be hidden.
copy-block-state true or false Only applies to loot tables of type BLOCK. Allows copying the tile entity state of the block that was broken into the item.
copy-block-data true or false Only applies to loot tables of type BLOCK. Allows copying the block data of the block that was broken into the item.
copy-block-name true or false Only applies to loot tables of type BLOCK. Allows copying the name of the block container that was broken onto the item.
smelt-if-burning true or false Only applies to loot tables of type ENTITY. Smelts the resulting item if the looted entity is on fire.

Randomly Applied Enchantments

An item can have random enchantments applied. The following is an example.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:villager'
pools:
  0:
    conditions: []
    entries:
      0:
        conditions: []
        items:
          0:
            type: item
            item: diamond_sword
            amount: 1
            enchant-randomly:
              level: 30
              treasure: true
              uncapped: false

The level value is the enchantment table equivalent of the enchantments that will be put onto the item. treasure determines if enchantments such as mending can be applied to the item. uncapped is a for-fun value that allows the enchantments to exceed the vanilla limits of the enchantment table.

Random Enchantment

This differs from the above section as this only applies a single enchantment with a randomly chosen level. If you set random-enchantments: [] it will pick from every applicable enchantment for the item.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:villager'
pools:
  0:
    conditions: []
    entries:
      0:
        conditions: []
        items:
          0:
            type: item
            item: diamond_sword
            amount: 1
            random-enchantments:
              - sharpness
              - smite
              - bane_of_arthropods

Enchantments

If you don't want random enchantments, you can specify the exact enchantments you want instead.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:villager'
pools:
  0:
    conditions: []
    entries:
      0:
        conditions: []
        items:
          0:
            type: item
            item: diamond_sword
            amount: 1
            enchantments:
              sharpness: 5
              looting: 3

You can find a list of all enchantments here.

Enchantment Bonus

If you want to increase the number of a specific item that can drop when using an enchantment such as looting, you can do that with this section.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:villager'
pools:
  0:
    conditions: []
    entries:
      0:
        conditions: []
        items:
          0:
            type: item
            item: emerald
            amount: 1
            enchantment-bonus:
              enchantment: looting
              bonus-per-level: 1
              max-bonus-levels: 3

enchantment is which enchantment type that will increase the drop chance. You can find a list of all enchantments here. bonus-per-level is the amount to increase the max item drop amount by for each level of the enchantment. In the example above, using a sword with Looting III on it will drop between 1-4 emeralds. max-bonus-levels is optional and the maximum number of levels to use when applying the bonus, it defaults to unlimited.

Attribute Modifiers

If you want to make the dropped items do some crazy stuff, you can add attribute modifiers to them. This is a fairly complex feature, so just be warned.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:villager'
pools:
  0:
    conditions: []
    entries:
      0:
        conditions: []
        items:
          0:
            type: item
            item: diamond_sword
            amount: 1
            attributes:
              0:
                name: 'generic.max_health'
                amount: 20
                operation: add_number
                slot: hand

As you can see, you are able to add multiple attribute modifiers. To add more, just add another entry under attributes.

name is the name of the attribute; valid names can be found here. amount is the value of the attribute. In the case of generic.max_health here, it is the amount of health to increase by. The value of 20 means 20 health, which is 10 additional hearts.

operation is a bit complicated to understand. The valid values are add_number, add_scalar, and multiply_scalar_1. add_number will add to the existing value. add_scalar will multiply all other modifiers by the amount. multiply_scalar_1 will add the base value multiplied by the amount specified.

slot determines when the attribute modifier will be applied. Valid values can be found here. If no slot is specified, it will apply for all slots.

Axolotl Bucket Meta

Applicable to axolotl_bucket items. variant allows changing what color of axolotl will spawn from the bucket. Valid values can be found here. copy-looted can be true or false, if it's true and the loot table type is ENTITY and the killed entity was an axolotl, the axolotl type will be copied into the bucket.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:axolotl'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: axolotl_bucket
            amount: 1
            variant: blue
            copy-looted: false

Banner Meta

Applicable to all banner items. You may specify a list of patterns and provide the color and pattern (type) for each pattern. Valid colors can be found here and valid pattern types can be found here.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: white_banner
            amount: 1
            patterns:
              0:
                color: red
                pattern: rhombus_middle
              1:
                color: blue
                pattern: flower

Written Book Meta

Applicable to writable_book items. You may specify the book title, author, pages (page content), and generation (how the book was created).

title and author are both text values that do not support color codes, pages is a text list that supports color codes, and generation values can be found here.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: written_book
            amount: 1
            title: 'Book of Mysteries'
            author: 'A Lost Soul'
            pages:
              - '<r:0.5>The first page with super magical rainbow colored text!'
              - 'The boring second page with default colored text.'
            generation: tattered

Enchantment Storage Meta

Applicable to enchanted_book items. Functions identically to applying enchantments to a normal item, except they will be added as enchantments stored in the enchanted book instead.

Firework Effect Meta

Applicable to firework_star items. This is not for the actual firework items, just for the star.

flicker can be true or false and determines if the firework will flicker. trail can be true or false and determines if the firework particles will leave a trail behind them. type determines the shape of the firework; valid types can be found here. colors is a list of colors that the particles will be, and it can contain color names or hex codes. fade-colors functions the same as colors, except it will be the color the particles fade to over their lifetime. A list of valid firework color names can be found here.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: firework_star
            amount: 1
            flicker: true
            trail: true
            type: large_ball
            colors:
              - '#FF00FF'
              - 'orange'
            fade-colors:
              - 'red'
              - '#00FFFF'

Firework Meta

Applicable to firework_rocket items. Determines what power and effects a firework rocket will have. The power value will determine how far up the firework flies; the normal craftable range is between 1 and 3, but higher values can be used. The firework-effects section functions identically to how it does in Firework Effect Meta, but is provided as a list.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: firework_rocket
            amount: 1
            power: 2
            firework-effects:
              0:
                flicker: true
                trail: true
                type: large_ball
                colors:
                  - '#FF00FF'
                  - 'orange'
                fade-colors:
                  - 'red'
                  - '#00FFFF'

Knowledge Book Meta

Applicable to knowledge_book items. Allows you to configure what recipes a knowledge book will unlock when used. You may provide a recipes list using the internal recipe IDs, or you may leave the value off entirely. If no recipes list is provided, the knowledge book will unlock all recipes.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: knowledge_book
            amount: 1
            recipes:
              - 'beacon'
              - 'bone_meal_from_bone_block'
              - 'white_dye_from_lily_of_the_valley'

Leather Armor Meta

Applicable to leather armor items (leather_helmet, leather_chestplate, leather_leggings, leather_boots). Allows the ability to color the armor using hex codes.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: leather_chestplate
            amount: 1
            color: '#C0FFEE'

Potion Meta

Applicable to potion, splash_potion, and lingering_potion items. This is by far the most complex item meta type, so be warned.

color determines the color of the potion; this must be a hex code. potion-type is the main effect of the potion; values can be found here.

upgraded can be true or false and determines if the potion has had glowstone added to it in a brewing stand; setting it to true makes it level 2. extended can be true or false and determines if the potion has had redstone added to it in a brewing stand; setting it to true makes it have a longer effect duration.

custom-effects allows you to configure additional effects for the potion. effect is the potion effect type. duration is the duration in seconds. amplifier is the level of the effect plus 1; if the amplifier is 1, the effect level will be 2.

ambient can be true or false; if true, the particles given off by this effect will be transparent. particles can be true or false; if false, no particles be will given off by this effect. icon can be true or false; if true, an icon for the effect will appear in the corner of the player's screen. overwrite can be true or false; if true, it will overwrite any existing effects of the same type on the player when applied.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: splash_potion
            amount: 1
            color: '#FF0000'
            potion-type: instant_damage
            upgraded: true
            extended: false
            custom-effects:
              0:
                effect: regeneration
                duration: 100
                amplifier: 1
                ambient: false
                particles: true
                icon: true
                overwrite: true
              1:
                effect: luck
                duration: 100
                amplifier: 0
                ambient: true
                particles: true
                icon: true
                overwrite: true

Player Head Meta

Applicable to player_head items. Only one value out of all of the ones listed here can be used. If you use multiple, only one will be applied.

texture is the Base64 texture string for the head to use; you can find an example value here. owner can be a player UUID or name. hdb-id uses a head ID and will only work when the plugin HeadDatabase is installed. There are two additional values of copy-looted and copy-looter, both of which accept either true or false values; if true, they will copy the player's head for the looted entity (if a player) and looter (if a player) respectively. copy-looted only works for loot tables with a type of ENTITY.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: player_head
            amount: 1
            owner: '27f49f81-0a43-445b-8d82-246badecf358'

Suspicious Stew Meta

Applicable to suspicious_stew items. This functions almost identically to the additional effects in the Potion Meta. If pick-random-effect is optionally set to true, it will pick a single random effect from the custom-effects list.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: suspicious_stew
            amount: 1
            pick-random-effect: false
            custom-effects:
              0:
                effect: regeneration
                duration: 100
                amplifier: 1
                ambient: false
                particles: true
                icon: true
                overwrite: true

Tropical Fish Bucket Meta

Applicable to tropical_fish_bucket items. body-color allows changing the body color of the fish; valid values can be found here. pattern-color allows changing the color of the pattern of the fish; the same values are allowed as body-color. pattern determines the pattern on the fish; valid values can be found here. The value of copy-looted can be true or false; if true and the loot table type is ENTITY and the looted entity is a tropical fish, the properties of the fish will be copied into the bucket.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: tropical_fish_bucket
            amount: 1
            body-color: white
            pattern: stripey
            pattern-color: orange

Bundle Meta

Applicable to bundle items. As of 1.17, bundles now exist in the game and can be filled with pretty much anything, even other bundles. You can use a list of valid loot items as the contents of the bundle.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: bundle
            amount: 1
            display-name: '&dLoot Bag'
            contents:
              0:
                item: diamond
                amount:
                  min: 1
                  max: 3
              1:
                item: emerald
                amount:
                  min: 1
                  max: 3

Exploration Map Meta

Applicable to map items. destination determines what feature the map will navigate towards; valid values can be found . here scale allows the zoom of the map to be changed; valid values can be found here. search-radius determines how many chunks away from the loot generation location to check for a structure with the same type as the destination, must be whole number greater than or equal to 0. skip-known-structures determines if additional chunks can be generated to locate the desired destination type and can be true or false.

type: ENTITY
overwrite-existing: none
conditions:
  - 'entity-type:pig'
pools:
  0:
    entries:
      0:
        items:
          0:
            type: item
            item: tropical_fish_bucket
            amount: 1
            body-color: white
            pattern: stripey
            pattern-color: orange