Sell wand
How a sell wand values a container, what it leaves behind, and every key that changes the payout.
A sell wand turns a full chest into money in one click. The player right-clicks a container, the wand prices everything inside, pays them, and empties only the slots it actually sold.
Set it up with type: sell in wands.yml.
How a sale is worked out
Group the contents
Identical stacks are grouped together, matching on the full item including name, enchantments and everything else. A double chest full of stone is one group, not thirty six.
Price each group once
Each group gets one price lookup, for a single item, and the answer is multiplied by how many there are. This is why a full double chest costs one lookup per item type instead of one per slot. Where the price comes from is set by prices.order.
Add it up and apply the boost
The priced total is multiplied by the wand's boost, then rounded to two decimals.
Check the minimum and the cap
Below minimum-value the sale is refused and nothing is taken. Above maximum-value the payout is capped and the player is told.
Pay, then empty the sold slots
The money goes in first. Only then are the sold slots cleared, and only the sold ones.
What gets left behind
Three things stay in the container:
- Anything on the wand's
blacklist. - Anything not on the wand's
whitelist, when that list is not empty. - Anything no price source has a price for.
An item nobody prices is treated as having no price, never as being worth zero. Zero would read as a free item and the wand would take it for nothing.
Setting selling.cancel-on-unpriced: true in config.yml changes the third case. Instead of skipping the unpriced item, the whole sale stops and the player is told which item blocked it.
Which containers work
Only the blocks listed under containers in config.yml:
containers:
- CHEST
- TRAPPED_CHEST
- BARREL
- SHULKER_BOXTwo things worth knowing:
- A double chest counts as one container. Clicking either half sells the whole thing.
SHULKER_BOXcovers the coloured ones. You do not need sixteen more lines for the dyed variants.
Right-clicking a block that is not in the list does nothing at all. The wand stays out of the way, no message, no cancelled interaction, so players can still open chests normally with the wand in hand if you take chests off the list.
Keys on a sell wand
| Key | What it does | Default |
|---|---|---|
type | Must be sell | none |
boost | Multiplies the priced total | 1.0 |
minimum-value | Sales worth less than this are refused | 0.0 |
maximum-value | Highest payout one sale can give. 0 turns the cap off | 0.0 |
uses | Uses a fresh wand starts with | 0 |
uses-per-action | Uses one sale costs | 1 |
on-empty | break or keep at zero uses | break |
cooldown | Seconds between uses, per player | 0 |
whitelist | Only these materials are sold. Empty means everything | empty |
blacklist | These materials are never sold | empty |
sound | Played on a successful sale | none |
show-item-count | Puts the item count in the message | true |
show-boost | Puts the boost in the message | true |
Everything under item (material, name, lore, glow, model data, flags, durability bar) is shared with the other types and is covered on Defining wands.
uses-mode, length and bag-default do nothing on a sell wand. They are builder keys.
The sale message
show-item-count and show-boost pick which of three messages the player gets.
show-item-count | show-boost | Message used |
|---|---|---|
true | true | sell.success-with-boost, count and boost both shown |
true | false | sell.success, count shown |
false | either | sell.money-only, money only |
With show-item-count: false the boost is never shown, whatever show-boost says. Wording for all three lives in your language file, see Messages and language.
The boost stacks
If your shop plugin already gives that player a multiplier through a permission or a rank, the wand boost multiplies on top of it. A 2x rank multiplier and a boost: 1.25 wand pay 2.5x the base price. This is deliberate. Price a wand's boost with that in mind.
Example
wands:
seller:
type: sell
item:
material: BLAZE_ROD
name: "&aSelling Staff"
custom-model-data: 1001
glow: true
durability-bar: false
flags:
- HIDE_ATTRIBUTES
- HIDE_ENCHANTS
lore:
- "&7Right-click a chest to sell what is inside."
- ""
- "&fBoost: &a{boost}x"
- "&fUses left: &a{uses}"
uses: 250
uses-per-action: 1
on-empty: break
boost: 1.25
cooldown: 3
minimum-value: 1.0
maximum-value: 0.0
permission: wandworks.use.seller
whitelist: []
blacklist:
- BEDROCK
sound: ENTITY_EXPERIENCE_ORB_PICKUP
show-item-count: true
show-boost: trueWhen it refuses
| What the player sees | Why |
|---|---|
| Selling is off because no economy plugin was found | No Vault economy is installed |
| There is nothing inside to sell | The container is empty |
| None of these items have a sell price | Everything inside is blacklisted, off the whitelist, or unpriced |
| The sale was cancelled because X has no price | selling.cancel-on-unpriced is on and X was unpriced |
| The contents are worth less than the minimum of X | The boosted total came in under minimum-value |
| This wand has no uses left | The wand is empty and on-empty is keep |
| Wait Ns before using this again | The wand's cooldown has not run out |