# 📦 Items

> **Info:**
Items are saved in their category's file, under its list of items.

## Add an Item

Left-click the lime stained glass in **Editor > Shops > Shop > Category > Items** to create an item. It gets the next free `item_<number>` identifier and its editor opens straight away.

<figure><img src="../../.gitbook/assets/items/items.png" alt="" width="563"><figcaption><p>Edit Category (Items)</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/items/add-an-item.png" alt="" width="563"><figcaption><p>Items (New Item)</p></figcaption></figure>

Clicking the glass creates an item with iron bars as a placeholder, to be replaced from its [display item](edit-item.md#display-item).

## Drop Items In

Drop an item from your inventory on an empty slot of the list, or shift-click it in your inventory, to add that exact item, name, lore, enchantments and custom data included. The stack's size becomes the item's amount, and you keep your copy. You stay on the list, so you can add as many as you like and click each one later to edit it.

> **Info:**
An item added this way is also added as its first [purchase item](#purchase-items), and chat tells you so. That is what a buyer receives and what a seller has to hand in, so later changes to the display item's name or lore do not change it.

## Items List

Every item in the list is shown as its display item, with its lore, then its buy price and sell price in the currency it uses, and the amount one purchase gives. A price of 0 is left off, and a spawner shows the mob it spawns. Left-click an item to edit it, right-click it to delete it after a confirmation.

<figure><img src="../../.gitbook/assets/items/items-list.png" alt="" width="563"><figcaption><p>Items (Stone)</p></figcaption></figure>

The order of the list is the order players see in the category's menu.

## Reordering

Turn Reordering on, click the item you want to move, then click the item it should swap places with. The New Item slot is hidden while reordering is on.

<figure><img src="../../.gitbook/assets/items/reordering.png" alt="" width="563"><figcaption><p>Items (Reordering)</p></figcaption></figure>

## Display Item

The display item is what players see in the category's menu. When the item has no [purchase items](#purchase-items) and no [purchase commands](#purchase-and-sell-commands), it is also what a purchase gives.

Drop an item on the slot to replace the display item. The dropped item's name, lore and data are taken as they are, and any name, lore or property set in the editor before is cleared. If the item had no purchase items yet, the dropped item is also added as the first one.

<figure><img src="../../.gitbook/assets/display-item/display-item.png" alt="" width="563"><figcaption><p>Display Item</p></figcaption></figure>

### Display Name

The name the item carries in the shop. Color codes are supported. Left empty, the item keeps its own name.

<figure><img src="../../.gitbook/assets/display-item/display-name.png" alt="" width="563"><figcaption><p>Display Item (Display Name)</p></figcaption></figure>

### Display Lore

The lore shown under the name. Color codes are supported. Left empty, the item keeps its own lore.

<figure><img src="../../.gitbook/assets/display-item/display-lore.png" alt="" width="563"><figcaption><p>Display Item (Display Lore)</p></figcaption></figure>

### Amount

How many are in the display item, from 1 to 64. It is also the size of one lot: selling one lot takes this many matching items from the player,. The display item itself is never given; set [purchase items](#purchase-items) for that.

<figure><img src="../../.gitbook/assets/display-item/amount.png" alt="" width="563"><figcaption><p>Display Item (Amount)</p></figcaption></figure>

### Item Properties

RGB color, item flags, banner patterns, enchantments, custom model data or item model, tooltip style, enchantment glint, potion effects, armor trim and spawner type. They have their own page: [Item Properties](item-properties.md).

<figure><img src="../../.gitbook/assets/display-item/item-properties.png" alt="" width="563"><figcaption><p>Display Item (Item Properties)</p></figcaption></figure>

## Purchase Items

### What a Purchase Gives

Purchase items are the real items a player receives when buying this entry. The display item is only what the shop shows, and is never given. An entry can hold as many as you want, and every one of them is given on each purchase.

<figure><img src="../../.gitbook/assets/purchase-items/purchase-items.png" alt="" width="563"><figcaption><p>Edit Item (Purchase Items)</p></figcaption></figure>

| Purchase items | Purchase commands | A purchase gives |
| --- | --- | --- |
| Set | Any | Every purchase item, then runs the commands. |
| Empty | Set | Nothing but the commands. |
| Empty | Empty | Nothing. The entry cannot be bought, and the editor warns on the Purchase Items option. |

Buying several at once multiplies each purchase item's amount by how many were bought. The player needs room for all of them, or the purchase is refused and nothing is taken.

### Add a Purchase Item

Click an item in your own inventory to pick it up, which turns the list green, then click anywhere in the list to add it. The item is taken from your cursor, exactly as it is, enchantments and custom data included.

<figure><img src="../../.gitbook/assets/purchase-items/add-an-item.png" alt="" width="563"><figcaption><p>Purchase Items (Add Item)</p></figcaption></figure>

Every purchase item in the list shows its lore and amount. Left-click one to edit it, right-click it to receive a copy.

### Edit a Purchase Item

Each purchase item has its own display name, lore, amount and [item properties](item-properties.md), separate from the display item's.

<figure><img src="../../.gitbook/assets/purchase-items/edit-a-purchase-item.png" alt="" width="563"><figcaption><p>Purchase Items (Stone)</p></figcaption></figure>

#### Purchase Item

Drop an item on the slot to replace this purchase item, keeping its amount. Right-click it to receive a copy.

<figure><img src="../../.gitbook/assets/purchase-items/purchase-item.png" alt="" width="563"><figcaption><p>#1 (Purchase Item)</p></figcaption></figure>

#### Display Name & Display Lore

The name and lore the given item carries. Left empty, the item keeps its own.

<figure><img src="../../.gitbook/assets/purchase-items/display-name.png" alt="" width="563"><figcaption><p>Purchase Item (Display Name)</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/purchase-items/display-lore.png" alt="" width="563"><figcaption><p>Purchase Item (Display Lore)</p></figcaption></figure>

#### Purchase Item Amount

How many of this item one purchase gives, from 1 to 64.

<figure><img src="../../.gitbook/assets/purchase-items/amount.png" alt="" width="563"><figcaption><p>Purchase Item (Amount)</p></figcaption></figure>

#### Remove

Removes this purchase item from the entry and hands it back to you.

<figure><img src="../../.gitbook/assets/purchase-items/remove.png" alt="" width="563"><figcaption><p>Purchase Item (Remove)</p></figcaption></figure>

### Selling

A player sells this entry by handing in items that match its **Sell Item**, set from the item editor. Without a sell item, they have to match the display item. How close the match has to be is the item's [Selling Rule](edit-item.md#selling-rule).

<figure><img src="../../.gitbook/assets/purchase-items/selling.png" alt="" width="563"><figcaption><p>Edit Item (Sell Item)</p></figcaption></figure>

One sale takes the sell item's amount of matching items and pays the sell price once, so an entry can sell a block of diamonds but buy back single diamonds. Without a sell item, one sale takes the display item's [amount](#amount).

In the item editor, drop an item on the Sell Item slot to set it, left-click it to edit its name, lore, amount and properties, and right-click it to get a copy. Its Remove button clears it, so the display item is matched again.

## Purchase and Sell Commands

### Purchase Commands

Commands run when a player buys this entry, after the [purchase items](#purchase-items) are given. An entry with purchase commands and no purchase items gives no items at all, which is how a rank, a kit from another plugin or a balance is sold.

<figure><img src="../../.gitbook/assets/purchase-and-sell-commands/purchase-commands.png" alt="" width="563"><figcaption><p>Edit Item (Purchase Commands)</p></figcaption></figure>

### Sell Commands

Commands run when a player sells this entry, after they are paid.

<figure><img src="../../.gitbook/assets/purchase-and-sell-commands/sell-commands.png" alt="" width="563"><figcaption><p>Edit Item (Sell Commands)</p></figcaption></figure>

### Add a Command

Left-click the lime stained glass and type the command, without the slash. A dialog box asks for it, and on server versions that don't support dialogs it falls back to the chat. Left-click a command in the list to remove it.

<figure><img src="../../.gitbook/assets/purchase-and-sell-commands/add-a-command.png" alt="" width="563"><figcaption><p>Purchase Commands (Add Command)</p></figcaption></figure>

Commands run from the console. Start one with `*` to run it as the player instead, such as `*spawn`.

### Placeholders

| Placeholder | Description |
| --- | --- |
| `%player%` | The name of the player. |
| `%uuid%` | The UUID of the player. |
| `%amount%` | How many times the entry was bought or sold in this transaction. |
| `%item%` | The name of the display item. |
| `%price%` | The total price of the transaction. |
| `%currency%` | The name of the currency. |
| `%shop%` | The display name of the shop. |

PlaceholderAPI placeholders work too when PlaceholderAPI is installed.

> **Info:**
Each command runs once per transaction, however many were bought or sold at once. `%amount%` counts those purchases, not items: buying 3 of an entry whose display amount is 16 fills in `3`.

Source: https://www.phoenixplugins.com/docs/phoenix-shop/main-features/items