# Item Casino
**A casino for your Minecraft server, played with the items you actually carry.**
Stake a stack of iron against a diamond pickaxe, bet chips at the blackjack table, or try your luck at
the Vault for the server's shared jackpot. Every table knows what every item is worth, so the odds come
out fair, minus a small house edge that is written on the table.
No real money is involved: everything is won and lost in game.
## The games
| Table | Stake | Returns | In short |
|---|---|---|---|
| **Upgrader** | items or chips | 90 % | Pick a target item and spin the wheel at the odds of the trade. Win and the target is yours. |
| **Predict the Dice** | chips | 97 % | Choose a chance from 1 to 95 % and a side of the line; the server rolls 0.00 to 99.99. |
| **Blackjack** | items or chips | ~99.4 % | Up to three players against one dealer. Double, late surrender, 3:2 blackjacks. |
| **Coin Flip** | items or chips | 100 % | A duel between two players. Each one's chance is its share of the pot. |
| **Slot Machine** | items or chips | 90 % | Three reels, triples up to x800, pairs from Iron up. |
| **Mine Field** | chips | 97 % | A 5x5 board with 1 to 24 mines. Cash out whenever you like. |
| **The Vault** | items or chips | 80 % | Draw for a share of the shared jackpot, from 1 to 100 %. |
*Returns* is the long-run share of the stake paid back (Blackjack with basic strategy).
Every table has an **(i)** in its corner that explains how its game is played.
## Every item has a price
A valuation engine prices every item from the recipes it takes to make, starting from a few base
values. Hold **Shift** over any item to see its casino value. Items that cannot be priced fairly, and
containers such as shulker boxes and bundles, are refused at the tables.
## Chips and the Cashier
The **Cashier** turns diamonds, emeralds, gold, iron and copper (ingots, nuggets or blocks) into chips
at their full value, stored on a **Chip Card**. The card is bearer: whoever holds it owns the chips.
Cashing out gives the same currencies back, for a 2 % fee.
## The shared jackpot
What players lose at the house tables feeds one server-wide pot. The only way to win it is at the
Vault, and every win is announced in chat.
## Blackjack for three
One shoe, one dealer, up to three chairs, each playing in turn and settling on its own. Alone at the
table, *Deal* deals. With others there, *Ready* starts a 10-second countdown, and the cards come out
once everyone is ready. During a shared hand each player has 15 seconds per move, so nobody who walked
away can hold up the table.
## Also included
- **Pocket devices**: an Upgrader, a Dice and a Blackjack table you carry in your inventory.
- **Stats** for every player (the **$** button in the inventory).
- A **mailbox** for winnings that cannot be handed over right away.
## Crafting
Every table is one **Game Core** (8 redstone around a gold ingot), five planks and the item that names
the table:
| Table | Item | Table | Item |
|---|---|---|---|
| Upgrader | smithing table | Slot Machine | lever |
| Predict the Dice | quartz block | Mine Field | TNT |
| Blackjack | book | The Vault | nether star |
| Coin Flip | gold ingot | Cashier | emerald |
Nothing costs a diamond. A pocket device is its table surrounded by 4 paper and 4 gold nuggets. The
recipes unlock in the recipe book as you pick up their ingredients.
## Fair by construction
- **The server decides everything.** Each outcome is drawn once, when the bet is placed, from a secure
random source. The client only plays the animation, and no result shows before it ends.
- **Every stake is held in escrow.** A game cannot pay twice. A game interrupted by a restart is
finished from the outcome already drawn.
- **Nothing is lost.** Winnings go to your inventory, or to the casino mailbox when they cannot.
Breaking a table settles it and returns every stake to its owner.
## For server owners
- Install on the **server and on every client**.
- Everything is set in `config/itemcasino-server.toml`: house edges, payout ceilings, blackjack rules,
the jackpot share, the chip fee, the timers. `safety.disabled_games` switches games off.
- The item tag `itemcasino:not_a_target` keeps items off the Upgrader's wheel.
- Commands: `/casino value` and `/casino odds` for everyone; `/casino diagnose`, `dump` and `rebuild`
for operators.
## Languages
English and French. The mod follows the language each player's game is set to.
## Made with AI
Item Casino was developed with the help of Claude, an AI assistant: much of the code was written with
it, under my direction, and every release is checked by an automated test suite that plays the games
in a real server.
## Links
- Source code, issues and changelog: [github.com/SVecro/ItemCasino](https://github.com/SVecro/ItemCasino)
- License: MIT

