DUXPLIMA Documentation

Mystery boxes

Boxes, their tables and weights, the roulette, duplicates, refunds, and who may open a box.

A mystery box costs its price, draws one piece from a weighted table, and gives it. Boxes are written in boxes.conf and opened from /cosmetics boxes or a box station.

The shipped boxes

BoxTierPriceTable
commoncommon1000flame_trail 30, pumpkin_crown 25, glass_sphere 25, emote_smile 20, emote_heart 20, chicken_pet 12, pig_pet 12, lapis_balloon 8 (duplicate 200), cloud_trail 5 (duplicate 300)
rarerare5000heart_trail 20, crit_trail 20, flower_crown 18, fox_pet 15, nyan_sheep 12, sun_banner 10, emote_cool 8 (duplicate 1200), gold_balloon 4 (duplicate 2000), ocean_suit 3 (duplicate 2500)
legendarylegendary20000totem_trail 10, gold_crown 10, beacon_balloon 12, panda_banner 12, enderman_pet 10, rainbow_suit 10, infernal_horror 8 (duplicate 4000), emote_angel 8 (duplicate 4000)

A piece's chance is its weight over the sum of the box's weights. A weight of 0 is never drawn.

Opening

  1. The node is checked: uxmcosmetics.box.<id>, or the permission the box names.
  2. The price is taken.
  3. One entry is drawn.
  4. A new piece is written to the wardrobe; one the player owns pays coins back instead.
  5. The roulette spins and lands on that piece.

The prize is paid for and written before the first frame, so a player who closes the roulette keeps what they won.

No player may open a box by default

A box needs uxmcosmetics.box.<id>. No player holds one by default, and uxmcosmetics.box.* declares no children, so it grants nothing on its own. Grant each box's node, such as lp group default permission set uxmcosmetics.box.common true, or give the box a permission your players hold.

Duplicates

A piece the player already owns pays coins instead: the entry's duplicate-coins, or when it writes none, economy.duplicate-refund-fraction (0.25) of the piece's own price. A piece held only by node is not owned, so it can still be won.

Answers

AnswerWhen
box.wonA new piece
box.duplicateCoins back, with the amount
box.not-permittedNo node
box.no-economyThe currency's plugin is not on the server
box.not-enoughWith the price and the balance
box.brokenThe drawn entry names a piece no file defines. The price is refunded

A box with no entry, or whose weights are all 0, is refused when the file is read and named in the console.

Related: boxes.conf, Boxes window, Box stations