Skip to content

Defining itemstacks

Leonardo Bishop edited this page Jul 22, 2021 · 2 revisions

This page gives guidance on how to define pouches with specific attributes.

An ItemStack is simply a representation of an item in an inventory.

Configurable options

Valid fields for each item

Field Required Notes Minecraft Version Example
name Supports colour. - Jump
item Full list of supported items here. - Jump
lore Supports colour. 1.8+ Jump
enchantments For 1.13+, you must use the namespaced enchantment name (see example) in the format "{namespace}:{name}:{level}". For pre-1.13, you must use the spigot name (list here) in the format "{name}:{level}". 1.8+ Jump
itemflags Full list of supported itemflags here. 1.8+ Jump
unbreakable - 1.13+ Jump
attributemodifiers The UUID should always be specified otherwise the server will randomly generate one on each restart causing items already existing in the world to not be recognised by the plugin. Full list of attributes here and operations here. 1.13+ Jump
custommodeldata - 1.14+ Jump
owner-[...] Used specifically for skull item stacks to define the player skin / username. 1.8+ Jump

Configuration layout

pouches:
  tier:
    vault-2:
      name: "&c&lTier II Money Pouch &r&7(Right Click)"
      item: "ENDER_CHEST"
      lore:
        - "&7Open this pouch to receive money!"
      # field4: value4
      # etc...
      pricerange:
        from: 10001
        to: 50000
      options:
        economytype: "VAULT"

Examples

name (return)

The name is displayed at the top of the item when hovered over, or just above the hotbar when selected.

pouches:
  tier:
    vault-2:
      name: "&2&lSuper Cool Name"
    ...

item (return)

The item is the material the itemstack is made out of. Please see this list (1.13+) or this list (1.8-1.12) for item names. For 1.8-1.12, data codes can be added on at the end with a colon :<code>.

pouches:
  tier:
    vault-2:
      item: "WHEAT"
    ...

lore (return)

The lore is the description of the item seen when hovering over it. You can remove this omit entirely if a lore is not desired.

pouches:
  tier:
    vault-2:
      lore:
       - "Line 1"
       - "Line 2"
    ...

enchantments (return)

The format of enchantments depends on your Minecraft version.
Pre-1.13: Use Spigot names -> format "{enchantment}:{level}"
1.13+: Use Vanilla names -> namespace for vanilla enchantments is "minecraft" -> format "{namespace}:{enchantment}:{level}"

pouches:
  tier:
    vault-2:
      enchantments:
       - "minecraft:infinity:1"
    ...

itemflags (return)

Item flags can be added to hide enchantment names, etc. Full list of itemflags here.

pouches:
  tier:
    vault-2:
      itemflags:
       - "HIDE_ATTRIBUTES"
    ...

unbreakable (return)

1.13+

pouches:
  tier:
    vault-2:
      unbreakable: true
    ...

attributemodifiers (return)

1.13+ Adds specific attribute modifiers to the items. The UUID should always be specified otherwise the server will randomly generate one on each restart. Full list of attributes here and operations here.

pouches:
  tier:
    vault-2:
      attributemodifiers:
        - attribute: GENERIC_MOVEMENT_SPEED
          modifier:
            uuid: "49dc07dc-bfdb-4dc7-85d3-66ef52b51858"
            name: "generic.movementSpeed"
            operation: ADD_NUMBER
            amount: 0.03
            equipmentslot: HAND
        - attribute: GENERIC_MOVEMENT_SPEED
          modifier:
            uuid: "e22513cf-b15f-4443-9e2f-103c0ff9731b"
            name: "generic.movementSpeed"
            operation: ADD_NUMBER
            amount: 0.01
            equipmentslot: OFF_HAND
      ...

custommodeldata (return)

1.14+

pouches:
  tier:
    vault-2:
      custommodeldata: 12345
    ...

owner (return)

This only applies if you have a skull item stack (PLAYER_HEAD 1.13+, SKULL_ITEM 1.8-1.12). There are three ways to define the player for the skull: by username; uuid; or, base64 encoded string.

The preferred method is to explicitly specify a base64 encoded string. Using any of the other two methods require that the player has joined the server before, and may possibly make a request to Mojang (locking the server thread) depending on which server software you use.

You can get the base64 encoded representation of a player skin here: https://mineskin.org/. It will look like the following (may be referred to as 'texture data'):

Example
ewogICJ0aW1lc3RhbXAiIDogMTYyNTgzNjU0OTAxNCwKICAicHJvZmlsZUlkIiA6ICJlMmNlNzA0ZWVjNGE0YjE4YTNlYjA4MTRiMzdmYTFkNCIsCiAgInByb2ZpbGVOYW1lIiA6ICJmYXRwaWdzYXJlZmF0IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzJiMTIzMWEyZjNkYTQ2OTQxZDY1OWI4NDNjZWZhNDljOGE1NTA0ZjE4MzNlOTA3YzY3YmJiMTQ2NTE0OTlhNyIKICAgIH0KICB9Cn0=

You can specify each type by the following:

pouches:
  tier:
    vault-2:
      owner-base64: "base64 encoded string"
    ...
pouches:
  tier:
    vault-2:
      owner-username: "username"
    ...
pouches:
  tier:
    vault-2:
      owner-uuid: "uuid"
    ...