# 🔨 Auction House

> **Info:**
The Auction House is in both editions. The parts marked ⭐ need Premium; on Lite a player can have up to 10 listings, sells at a fixed price in the default currency and uses the built-in categories. It is on by default; set `enabled: false` in auction-house.yml to turn it off.

## Information

The Auction House lets players sell items to each other. A listing either has a fixed price that anyone can pay right away, or it is an auction that goes to the highest bidder when time runs out.

Expired items, won auctions and anything that did not fit in an inventory go to the player's collection bin, so nothing is lost while a player is offline. Players who were offline when something happened get the messages the next time they join.

## Selling

Hold the item and open the sell menu with `/ah sell`. Pick the listing type, the price, how long it stays up and, when more than one is allowed, the currency. `/ah sell <price>` and `/ah auction <starting bid>` ⭐ list the held item straight away with the default duration.

The **Price Guide** ⭐ in the sell menu shows what the same item sold for over the last days: the average and the last price for one item, and how many sold. Clicking it sets the price to the average for the amount being sold. Custom items from item plugins are told apart from the vanilla item they are made of.

The listing fee is paid when the item is listed and is not refunded. The sales tax is taken from what the seller receives.

## Bundles ⭐

`/ah bundle <price>` or `/ah bundle <starting bid> auction` opens a menu where the player puts up to 27 stacks that sell together as one listing. The buyer or winner gets every stack; players see the contents with Shift + Left-Click. Closing the menu without listing gives everything back.

## Buying and bidding

A fixed-price listing can be bought whole, or in part when partial buys are on. A bid ⭐ has to beat the current one by the minimum raise. The money is taken when the bid is placed and given back as soon as someone outbids the player or the auction is closed.

A bid in the last moments of an auction extends it, so nobody can win by bidding a second before the end.

A seller can cancel a listing until an auction has its first bid. Staff can remove any listing with Press Q: the item goes to the seller's collection bin and the highest bidder gets their money back.

## Watchlist and reminders ⭐

Shift + Right-Click on a listing adds it to the player's watchlist, found in **My Auctions**. Watchers are told about new bids and when the listing ends.

The highest bidder and everyone watching are reminded shortly before a listing ends, by default five minutes and one minute before. Reminders only reach players who are online at the time; they are not saved for the next join.

## Listing again ⭐

An expired item in the collection bin can go straight back up with Right-Click, at the same price and type, without taking it out first. The listing fee and limits apply again.

## Server Restock ⭐

The server can put items up for sale on its own at a set interval, so the Auction House is never empty on a quiet server. Server listings carry the server's seller name, sit between the player listings and are bought like any fixed-price listing in the first auction currency; the money goes to nobody.

Each item has an amount, a price and how many listings of it go up per restock. After a restock where every listing of an item sold, its price rises by the price rise; when some were left over, it drops by the price drop, never past the item's lowest and highest price. A random variation can move it a little more each time. Changing an item's price starts it over from there.

Unsold server listings disappear at the next restock when Replace Unsold is on, otherwise when they end. Nothing goes to a collection bin, and staff removing one deletes it. Turning the restock on runs one straight away; a restart waits out the rest of the interval. Items are added from the one in your hand in **Editor > Auction House > Features > Server Restock**, which keeps custom items exactly as held.

## Categories

The categories in the menu come from auction-house.yml, in the order they are written; an item goes into the first one it matches, and into **Other** when it matches none. Changing them or adding your own ⭐ needs Premium.

```yaml
categories:
  crate-keys:
    enabled: true
    name: Crate Keys
    icon: TRIPWIRE_HOOK
    data-keys:
    - phoenixcrates:key
  blocks:
    enabled: true
    name: Blocks
    icon: GRASS_BLOCK
    types:
    - BLOCKS
```

| Rule | Matches |
| ---- | ------- |
| `types` | Built-in groups: `BLOCKS`, `COMBAT`, `TOOLS`, `FOOD`, `POTIONS`, `ENCHANTED_BOOKS`, `ENCHANTED`. |
| `items` | Materials or custom item ids, such as `DIAMOND` or `nexo:pineapple`; a `*` at the end matches the start, such as `nexo:*`. |
| `name-contains` | Items whose name contains one of these texts. |
| `data-keys` | Items that carry one of these data keys, such as `phoenixcrates:key` for crate keys. |

Set `enabled: false` to hide a category.

## Settings

The command and its aliases are set with the other [commands](../configurations/main-configuration.md#commands), under `auction-house`.

> **Info:**
Everything below can be changed in **Editor > Auction House**, where Premium-only options show as locked on Lite, or in auction-house.yml followed by `/pshop reload`.

| Option | What it does |
| ------ | ------------ |
| `enabled` | Turns the Auction House and its command on or off. |
| `currencies` ⭐ | The currencies a seller can choose from, by currency id. Starts with `money`; empty uses the default currency. |
| `listing-limit` | How many listings a player can have at once. `-1` is unlimited. A higher limit can be given by permission ⭐. Lite allows at most 10. |
| `durations` | The durations a seller can choose from, such as `30m`, `6h` or `2d`. |
| `default-duration` | The duration used by `/ah sell <price>`, bundles and listing again, and preselected in the sell menu. |
| `min-price`, `max-price` | The lowest and highest price or starting bid. `max-price` also caps bids. |
| `currency-prices` ⭐ | A `min-price` and `max-price` per currency id, replacing the ones above for that currency. Set in **Prices > Per Currency**; `0` uses the ones above. |
| `listing-fee.flat`, `listing-fee.percent` | The fee to list an item: a fixed amount plus a percentage of the price. |
| `sales-tax` | The percentage taken from every sale. |
| `currency-taxes` ⭐ | A sales tax per currency id, replacing `sales-tax` for that currency. Set in **Prices > Per Currency**. |
| `item-taxes` ⭐ | A sales tax per material, custom item id or wildcard, replacing the others for that item. Items dropped into **Prices > Tax per Item** are added here. |
| `partial-buys` | Whether buyers can buy part of a stack. |
| `bids.increase-percent`, `bids.increase-minimum` | The minimum raise over the current bid: the larger of the percentage and the fixed amount. |
| `bids.cancel-with-bids` | Whether a seller can still cancel an auction that has bids. Bidders are refunded. |
| `anti-snipe.window`, `anti-snipe.extend` | A bid placed less than `window` seconds before the end makes the auction end `extend` seconds after that bid. `0` turns it off. |
| `ending-reminders` | When the highest bidder and watchers are reminded before the end, such as `5m` and `1m`. Empty turns it off. |
| `watchlist-limit` | How many listings one player can watch. `0` is unlimited. |
| `sell-cooldown` | Seconds a player has to wait between two listings. |
| `broadcast-new-listings` | Whether every player is told about new listings. |
| `disabled-worlds` | Worlds where players cannot list items. |
| `blacklist.items` | Full items that cannot be listed, added by dropping them into **Blocked Items** in the editor. A plain item blocks every item of that type, an item with a name, lore or enchants only that exact item, and a custom plugin item that plugin item. |
| `blacklist.patterns` | Custom item ids or wildcards such as `*_spawn_egg` that cannot be listed, typed in **Blocked Items**. |
| `blacklist.name-contains`, `blacklist.lore-contains` | Items whose name or a lore line contains one of these texts cannot be listed. |
| `allow-list.enabled`, `allow-list.items`, `allow-list.patterns` ⭐ | When on, only these items can be listed. Items dropped into **Allowed Items** are added here, the same way as **Blocked Items**. |
| `price-guide.enabled`, `price-guide.days` ⭐ | The Price Guide in the sell menu, and how many days of sales it looks at. |
| `bundles.enabled`, `bundles.icon` ⭐ | Whether players can sell bundles, and the item that shows a bundle. |
| `server-restock.enabled`, `server-restock.interval` ⭐ | Whether the server restocks on its own, and how often, such as `6h` or `1d`. The shortest is `1m`. |
| `server-restock.seller-name`, `server-restock.duration` ⭐ | The seller name on server listings, and how long they stay up. |
| `server-restock.replace-unsold` ⭐ | Whether unsold server listings are taken down when the next restock starts. |
| `server-restock.price-change.up`, `.down`, `.random` ⭐ | The percentage a price rises after a sold-out restock, drops after one with leftovers, and moves at random each restock. |
| `server-restock.items` ⭐ | The items: `item` (a material or custom item id), `amount`, `price`, `min-price` and `max-price` (`0` is no limit), `stock` (listings per restock) and `enabled`. |

The tax is fixed when an item is listed, so a permission change later does not change what an existing listing pays. The blacklist and allow-list also apply to the contents of shulker boxes and bundles. Every message is in the translation file, under the `auction-house` section.

## Menus

Every menu can be laid out in game from **Editor > Auction House > Menus**, or changed in its file inside menus/auction-house: main.yml, sell.yml, bundle.yml ⭐, listings.yml, watchlist.yml ⭐, collection.yml, history.yml, preview.yml and one confirm menu per action, confirm-buy.yml, confirm-bid.yml ⭐, confirm-cancel.yml and confirm-remove.yml.

Bedrock players type prices, amounts, bids and searches in a form, and pick Shift and Press Q actions from a list. Java players get a dialog on Paper servers that support dialogs, and type in chat everywhere else.

## Discord

Listings, sales, bids, expired and removed listings and server restocks can be posted to Discord with the Premium edition, like the other [Discord Webhooks](discord-webhooks.md).

## Moving from another auction plugin

**Editor > Migrations** brings live listings, auctions, expired items and money still owed across from zAuctionHouse, PlayerAuctions, CrazyAuctions and Auction House (Kiranhart). Bids come across only when the old plugin took the bidder's money at bid time; otherwise the auction restarts at its price. Running it again skips what already came across. Remove the old plugin afterwards, since its files still hold everything.

## Placeholders

| Placeholder | Description |
| ----------- | ----------- |
| `%phoenixshop_ah_total%` | The number of listings on the auction house. |
| `%phoenixshop_ah_total_buy_now%`, `%phoenixshop_ah_total_auctions%` | The number of fixed-price listings and of auctions. |
| `%phoenixshop_ah_listings%` | The player's listings. |
| `%phoenixshop_ah_limit%` | The player's listing limit. |
| `%phoenixshop_ah_waiting%` | The entries in the player's collection bin. |
| `%phoenixshop_ah_winning%` | The auctions the player is the highest bidder on. |
| `%phoenixshop_ah_watching%` | The listings on the player's watchlist. |
| `%phoenixshop_ah_banned%` | Whether the player is banned from the auction house. |

## Files

| File | What it holds |
| ---- | ------------- |
| `PhoenixShop/auction-house.yml` | The settings above. |
| Plugin database | Listings, collection bins, sale history, watchlists, bans and messages waiting for offline players. |
| `PhoenixShop/translations/translations.<lang>.yml` | The messages, under `auction-house`. |

## Commands

| Command | Description |
| ------- | ----------- |
| `/ah` | Opens the auction house. |
| `/ah sell [price] [amount]` | Opens the sell menu, or lists the held item for a fixed price. |
| `/ah auction <starting bid> [amount]` ⭐ | Auctions the held item. |
| `/ah bundle <price> [buy-now\|auction]` ⭐ | Opens the bundle menu to sell several stacks as one listing. |
| `/ah find <item>` | Opens the auction house filtered by item or seller name. |
| `/ah listings` | Opens your listings. |
| `/ah collect` | Opens your collection bin. |
| `/ah history` | Shows what you bought and sold. |
| `/ah view <player>` | Shows every listing of one player. |
| `/ah open <player> <collection\|history>` ⭐ | Shows the collection bin or the history of one player. |
| `/ah ban <player>`, `/ah unban <player>` | Stops a player from listing, buying and bidding, or lets them again. |
| `/ah removeall <player> [confirm]` | Counts, then with `confirm` sends, every listing of one player to their collection bin and refunds every bid. |
| `/ah restock` ⭐ | Runs a server restock now. The next automatic one comes a full interval later. |

## Permissions

| Permission | What it allows | Default |
| ---------- | -------------- | ------- |
| `phoenixshop.auction.use` | Browsing, buying, bidding, the watchlist and the collection bin. | Everyone |
| `phoenixshop.auction.sell` | Listing items and bundles. | Everyone |
| `phoenixshop.auction.limit.<number>` ⭐ | A higher listing limit. `*` is unlimited. | - |
| `phoenixshop.auction.tax.<percent>` ⭐ | A lower sales tax; the lowest one the player has counts. | - |
| `phoenixshop.auction.admin` | Removing listings, `/ah view`, `/ah open`, `/ah ban`, `/ah unban`, `/ah removeall` and `/ah restock` ⭐. | Operators |

Source: https://www.phoenixplugins.com/docs/phoenix-shop/features/auction-house