Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 2.82 KB

items.md

File metadata and controls

102 lines (79 loc) · 2.82 KB

Items in configuration files

With PvPArena, all your arena configuration is stored in a dedicated config file. For some reasons, it could be useful to check it or edit it directly. This document will try to explain how you can edit list of items for inventories or enhancements directly in arena config files.

This is an advanced level tutorial, so if you aren't at ease with YAML config files, please use /pa class and /pa set commands.

JavaDoc : Bukkit Material ENUMs

Create a simple item list:

In order to create a basic list of items (without enchant or any enhancements), create a simple YAML list with two keys : "type" and "amount".

"Type" is the items name, it must be from the material enum page - cf. above link

"amount" is the number of items you want to give. This parameter is optional and, if not set, equals to 1 (and 64 for arrows)

Example:

items:
    - type: BOW
    - type: ARROW
      amount: 64
    - type: IRON_SWORD
    - type: COOKED_BEEF
      amount: 2

Create an advanced item list

The principle is the same, you just have to add a meta key to list items and add the good properties.

Enchantments

You can add enchantments according the following instance. The enchantment names must be picked from this page : Bukkit enchantments

  myclassname:
    items:
    - type: IRON_SWORD
      meta:
        enchants:
          DURABILITY: 3
          KNOCKBACK: 1
    offhand:
    - type: SHIELD
    armor:
    - type: IRON_CHESTPLATE
      meta:
        enchants:
          PROTECTION_ENVIRONMENTAL: 3

Custom names

Add a display-name key with the name you want, it works with every item.

    - type: COOKED_PORKCHOP
      amount: 8
      meta:
        display-name: Delicious bacon

Potion effects

You can use potion effects on these four items :

  • POTION
  • SPLASH_POTION
  • LINGERING_POTION
  • TIPPED_ARROW

You can set a potion type like in the following example :

    - type: TIPPED_ARROW
      amount: 5
      meta:
        potion-type: minecraft:slowness
    - type: SPLASH_POTION
      meta:
        potion-type: minecraft:healing
    - type: LINGERING_POTION
      amount: 2
      meta:
        potion-type: minecraft:strong_speed
    - type: POTION
      meta:
        potion-type: minecraft:long_invisibilty

You can get potion effects on this page : Potion type list

Be careful to prefix the effect with "minecraft:". You can give level 2 potions (like heath II) prefixing the effect with strong_ or long duration potions with the long_