Skip to content

Item Syntax

Redned edited this page Mar 14, 2020 · 1 revision

This page serves as a utility page for how item creation is managed in PwingRaces. Any time items are involved, you can refer to this page for how to create them.

Single-lined Items

Single-lined items mainly shows up in abilities. It's core purpose is to work as an item for casing abilities and potentially other features later on. It's very basic and the most you can define with it is the item name and type.

Here is an example:

"bone|&4B&cone &8R&7attler"

This can be used in the ability item section, and if you want to define multiple items, simply separate them with a comma. Here is another example:

"stick|&2Drudic &aHealing &5Branch,stick|&5Artifact of &aPrayer"

Items Defined VIA Configuration Sections

Items defined through configuration sections show up a lot more than single-lined items. One primary example is when defining race items. You are able to customize almost everything about the item that you please. Below you can see a table of what is customizable.

Modifier Name Type Description Default
material material Sets the item type. none
durability int Sets the item durability/data. 0
model-data (v1.14+ only) int Sets the custom model texture/data. 0
amount int Sets the item amount. 1
display-name string Sets the name of the item. none
enchantments string list Sets the enchantments of the item. none
lore string list Sets the lore of the item. none
unbreakable boolean Controls if an item is unbreakable. false
head-owner string Sets the head owner of a head (item must be a head) none
color RBG string Sets the color of an item (must be an item that can be colored) none
item-flags string list Sets the item flags for the item (See: ItemFlags) none
effects string list Sets the potion effects for the item (See: PotionEffectType none

Below is an example on how to define these modifiers:

specialsword:
    material: diamond_sword
    model-data: 2
    display-name: "&bSpecial Stone"
    lore:
    - "&7Right-click to cast a special ability!"
    - "&7Requires Race: &cWerewolf"
    unbreakable: true
    enchantments:
    - sharpness 1
    - smite 3
    item-flags: 
    - HIDE_ENCHANTS
    - HIDE_UNBREAKABLE
magicalpotion:
    material: potion
    display-name: "&5M&dagical &9P&botion"
    amount: 1
    color: 249,249,0 # You can also use hex values too
    lore:
    - "&7Right-click to drink!"
    effects:
    - speed 5 2 # First integer is duration, second is amplifier
    - jump 10 2
    item-flags:
    - HIDE_POTION_EFFECTS