Skip to main content

How to make an Item

Itemsโ€‹

Items are everything that can be bought or sold in the shop. They can be real items or commands, single-purchase, limited purchase, buy only, sell only, both, they can be bought with 2 different currency types - the point is, there's a lot of options to wrap your head around.

These items go into your category config, read here for more into: categories.

How to add itemsโ€‹

Simple buy-sell itemโ€‹

Let's start with a really simple shop item - if you're making a standard buy-sell shop, this is what most of your items will look like:

- id: cooked_mutton
item: cooked_mutton
buy:
type: coins
value: 20
display: $%value%
amount: 32
sell:
type: coins
value: 10
display: $%value%
gui:
column: 4
row: 1
page: 1

Understanding all the sectionsโ€‹

id: This is the internal ID of the item. Players don't see this, but it's important to use a unique ID for every item in all of your shops. This is used in commands, placeholders and referencing the item

item: This is the actual item we're selling, read here for more info: Item Lookup System.

Buy (Optional)โ€‹

type/value/display: This is standard configuration of prices, read here for more info: Prices. Prices are configured per-item.

amount: (Optional) The amount of items to be bought at once. Defaults to 1.

Sellโ€‹

type/value/display: This is standard configuration of prices, read here for more info: Prices. Prices are configured per-item.

GUIโ€‹

row/column/page: The location of this item in the shop

Command Itemsโ€‹

Sometimes you want to run a command when a player buys an item, such as giving permissions/ranks/items from other plugins not currently supported in the Item Lookup System.

Of course, you can't sell a command, so they're buy-only.

- id: iron_rank
command:
- lp user %player% parent set iron
buy:
value: "%ecomc_iron_price%"
type: crystals
display: "&b%value% Crystals โ–"
limit: 1
gui:
display:
item: diamond_chestplate name:"&aIron Rank"
lore:
- "&fBuy &7&lIRON&r&f rank to get"
- "&fthe following benefits:"
- " &8ยป&f &eExample Perk"
bottom-lore: # You can also add lore to be put under other lore (e.g. price, quick buy/sell info, etc.)
- ""
- "&e&oLeft click to buy with money,"
- "&e&oRight click to buy with &bCrystals โ–&e&o!"
column: 5 # The column.
row: 3 # The row.
page: 2 # The page.

Understanding all the sectionsโ€‹

id: This is the internal ID of the item. Players don't see this, but it's important to use a unique ID for every item in all of your shops. This is used in commands, placeholders and referencing the item

command: This is the command to be run when a player buys this item. You can use %player% and %amount% as placeholders.

Buyโ€‹

type/value/display: This is standard configuration of prices, read here for more info: Prices. Prices are configured per-item.

limit: (Optional) The max amount of times a player can buy this item.

GUIโ€‹

display.item: This is the item shown in the GUI, read here for more info: Item Lookup System.

display.lore: This is the lore shown on the item.

display.bottom-lore: Lore shown under other lore, such as displaying prices.

row/column/page: The location of this item in the shop

Effect Itemsโ€‹

Instead of just using commands, EcoShop also has full access to the effects system, so you can run effects when a player buys an item, or even just put effects themselves in the shop.

Like commands, these are unsellable.

- id: my_effect_item
effects: [ ]
buy:
value: 65
type: crystals
display: "&b%value% Crystals โ–"
global-limit: 5
gui:
display:
item: nether_star
lore:
- "&fBuy me to do something cool!"
column: 6 # The column.
row: 3 # The row.
page: 2 # The page.
show-quick-buy-sell: false

Understanding all the sectionsโ€‹

id: This is the internal ID of the item. Players don't see this, but it's important to use a unique ID for every item in all of your shops. This is used in commands, placeholders and referencing the item

effects: These are the effects that are ran when the player buys the item. Read here for more info: Configuring an Effect. Only Triggered Effects.

Buyโ€‹

type/value/display: This is standard configuration of prices, read here for more info: Prices. Prices are configured per-item.

limit: (Optional) The max amount of times a player can buy this item.

GUIโ€‹

display.item: This is the item shown in the GUI, read here for more info: Item Lookup System.

row/column/page: The location of this item in the shop

Alt-Buyโ€‹

EcoShop supports buying items with multiple currencies using the alt-buy options. All the options that work with buy also apply to alt-buy. These are configured the same way, using the price system.

    alt-buy:
value: 65
type: crystals
display: "&b%value%โ–"

Optional Argumentsโ€‹

Buyโ€‹

requireโ€‹

A mathematical expression that must be met to buy this item.

buy:
require: "%player_xp% >= 300"

conditionsโ€‹

Any conditions that must be met to buy the item. Read here for more info: Configuring a Condition.

buy:
conditions:
- id: has_permission
args:
permission: group.iron

limitโ€‹

The max times a player can buy this item.

buy:
limit: 1

global-limitโ€‹

The max times all players can buy this item.

buy:
global-limit: 1

max-at-onceโ€‹

The max amount of this item a player can buy at once. (Removes the multi-buy GUI).

buy:
max-at-once: 1

amountโ€‹

The amount of items to be bought at once.

buy:
amount: 32

buy-messageโ€‹

A message to be sent to the player when this item is bought.

buy:
. buy-message:
- "&6Thanks for buying this specific item"

Sellโ€‹

requireโ€‹

A mathematical expression that must be met to buy this item.

buy:
require: "%player_xp% >= 300"

conditionsโ€‹

Any conditions that must be met to sell the item. Read here for more info: Configuring a Condition.

sell:
conditions:
- id: has_permission
args:
permission: group.iron

sell-messageโ€‹

A message to be sent to the player when this item is sold.

sell:
. sell-message:
- "&6Thanks for buying this specific item"

sell-commandโ€‹

Commands to be run when the player sells this item.

sell:
. sell-command:
- "lp user parent set top.seller"

GUIโ€‹

show-quick-buy-sellโ€‹

By default, quick buy/sell lore is shown, disable it using show-quick-buy-sell

sell:
. show-quick-buy-sell: false

Internal Placeholdersโ€‹

PlaceholderValue
%amount%The amount of items the player bought
%value%The buy/sell value, to use in price display
%value_commas%The comma separated buy/sell value, to use in price display
%playerlimit%The per-player purchase limit for the item
%playerbuys%The amount of times the player has bought this item
%globallimit%The global purchase limit for the item
%globalbuys%The amount of times the item has been bought globally