Wifi Card Games (wifi-card-games)
A multiplayer card game collection mod for Minecraft 1.21.1 (Fabric · server-authoritative).
Currently includes:
-
Dou Dizhu (Fight the Landlord) – Classic / Wildcard modes, Standard / Folk rule sets
-
Board games – Reversi (Othello), Gomoku, and Go (shared lobby & room system)
-
UNO – up to 10 players
-
Mod ID:
wifi-card-games -
Entry point:
io.wifi.cards.CardGameMod(umbrella entry, preparing for future games) -
Submodules:
- Dou Dizhu:
io.wifi.cards.doudizhu - Board games:
io.wifi.cards.board(Othello/Gomoku/Go) - UNO:
io.wifi.cards.uno
- Dou Dizhu:
đ Language Support
| Language | Text (UI & Chat) | Voice (Sound Effects & TTS) |
|---|---|---|
| Chinese (Simplified) | â Supported | â Supported (Chinese TTS) |
| Chinese (Traditional) | â Supported | â Supported (Chinese TTS) |
| English | â Supported | â Not supported (fixed to Chinese voice) |
- Text includes all inâgame UI labels, chat messages, rule descriptions, and button texts.
- Voice refers to the voiceâover for UNO calls (“UNO”, “Draw two”) generated via edgeâtts. The voice is always in Chinese regardless of the selected language; English does not have its own TTS voice. Other sound effects use Minecraft’s builtâin sounds, which are languageâindependent.
- The mod automatically detects the client’s language setting and switches text accordingly.
- Traditional and Simplified Chinese are handled as separate locales (
zh_CNandzh_TW) with distinct translation files.
⨠Features
Rooms & Multiplayer (in-memory only, no persistence)
- Create room: choose Classic/Wildcard mode, Standard/Folk rule set, and whether to announce to chat.
- Oneâclick join: announced rooms show
[Click to Join]; or enter a room code manually. - Invite:
/doudizhu invite <player>sends a clickable invitation. - Autoâstart: when 3 players are ready, the game begins; you can leave anytime during waiting or playing.
Dou Dizhu Gameplay
- Bidding: pass / 1 / 2 / 3 points (must exceed current highest bid).
- Landlord contest: if someone bids 3, a round of “rob/not rob” follows; two consecutive “not rob” ends the round (base score 3). If no one bids 3, the highest bidder becomes landlord. If all pass, redeal.
- Card play: full hand-type recognition and comparison (single, pair, triple, triple+single, triple+pair, straight ≥5, consecutive pairs ≥3, airplane with wings, fourâwithâtwo, bomb, rocket – no tripleâking bomb). Bombs/rockets double the multiplier immediately.
- Wildcard mode (55 cards, 4 bottom cards): wildcards can substitute any card; wildcard + triple = wildcard bomb. Triple+pair is forbidden in this mode.
- Show hand: landlord may reveal all cards before playing the first hand – visible to all (cards are removed from display as they are played).
- 30âsecond turn timer: autoâaction on timeout.
Autoâplay & Stability
- Autoâplay: can be toggled at any time from the game screen (bidding → pass, robbing → not rob, playing → best move).
- Autoâplay on disconnect: if a player disconnects during a game, a bot takes over; on reconnect, full state sync (hand, bottom cards, multiplier, timer, revealed cards, autoâplay status).
- Exit game: players can voluntarily exit (button) or be kicked by an operator; their seat becomes botâcontrolled. If no real players remain, the room is closed.
Interface
- Textâbased card display: click/slide to select cards (sliding over unselected selects it, over selected deselects it – no missed cards), hint button, showâhand button.
- Inâgame chat: press the chat key (default T) to open chat; closing or sending returns to the game; chat history rendered by vanilla HUD.
- Lobby / rule introduction (scrollable, muteable) / settlement screen; no global blur – only content areas have a semiâtransparent dark background.
âď¸ Board Games (Reversi / Gomoku / Go)
All three board games share one lobby, room system, network protocol, and board interface (/chess).
The board is rendered via gui.pose().scale() to adapt to window size – it scales up for large windows and down for small ones, never overflowing or covering buttons; click detection remains accurate even at small sizes.
Rooms & Multiplayer
- Unified lobby
/chess: choose a game (Go offers 9×9 or 19×19) → create room; or enter a room code to join. - Room list in lobby: shows all rooms – waiting rooms can be joined; ongoing games can be spectated.
- Spectating: after a game starts, you can spectate (from lobby list / chat announcement /
/chess spectate <code>). Realâtime board display, unlimited spectators, exit anytime. - Autoâstart: when 2 players are ready, game begins; announced rooms are clickable;
/chess invite <player>to invite.
Gameplay
- Reversi (8×8): Black goes first; if no legal move, pass automatically; if both pass, count pieces to determine winner.
- Gomoku (15×15): Black first; first to get five in a row wins; full board = draw; no forbidden moves.
- Go (9 or 19 lines): Black first, play on intersections; liberties / captures / no suicide / simple ko; if both pass consecutively or 4 consecutive passes occur, score by Chinese rules with komi 3.75.
- 60âsecond turn timer: on timeout, Gomoku/Reversi let AI play one move (heuristic/greedy); Go simply passes.
- Resign anytime (Go also has a “pass” button).
- Rule introduction: lobby “Rules” button or inâgame “Rules” button (scrollable, full rules for all three games).
- Inâgame chat: press chat key (default T) to open; closing/sending returns to the board.
Autoâplay & Stability
- Gomoku/Reversi: on exit/disconnect, seat becomes botâcontrolled (AI plays); on reconnect, full snapshot sync.
- Go has no autoâplay: if a player exits/disconnects, the game ends immediately (the other wins); if both pass repeatedly, the game ends by counting.
- If no real players remain (or all offline), the game ends and the room is closed.
- Debug bot: for Gomoku/Reversi, you can add 1 AI opponent when creating a room (Go does not provide AI).
đ´ UNO (up to 10 players)
Standard 108 cards (4 colours 0–9 + Skip/Reverse/+2, 4 Wild, 4 Wild+4). Each player starts with 7 cards; the first card flipped must be a number card. Max 10 players per room. The host (seat 0) clicks “Start Game” to begin (needs at least 2 players; you may add 0–9 bots when creating the room).
Gameplay
- Play: must match colour or number with the top card; Wild cards can always be played (colour selection popâup before playing).
- Action cards: Skip skips next player; Reverse reverses direction (in 2âplayer games, it acts as Skip); +2 makes next player draw 2 and lose their turn; Wild+4 lets you choose colour and the next player draws 4 and skips (no “must have no matching colour” restriction – casual rule).
- Draw: if you cannot play, click “Draw” (or the deck) to draw 1 – if it’s playable, you may play or pass; if not, turn passes automatically. If deck is empty, reshuffle the discard pile (keep top card).
- UNO call: when you play your penultimate card (leaving 1), you must click “Call UNO!”. If you don’t and another player catches you with “Catch … UNO”, you draw 2 (the catch window closes after success). If no one catches you, you automatically draw 2 when it becomes your turn again (chat + table prompt + voice “Draw two”). The window for catching expires when your next turn starts.
- First to empty hand wins (single round). Settlement screen offers “Play again” (room stays open, restart).
- 30âsecond turn timer: on timeout, autoâdraw (and autoâplay if possible).
Autoâplay & Stability
- Autoâplay: togglable anytime (finds playable card, autoâselects colour, autoâcalls UNO).
- Autoâplay on disconnect: bot takes over; on reconnect, full sync (hand, current colour, direction, timer, UNO status, autoâplay status).
- Exit: voluntary exit or kick; seat becomes botâcontrolled. If no real players remain, room closes.
- Spectating: after game starts, spectate via chat announcement or
/uno spectate <code>– left panel shows every spectator the complete hands of all players. - Voice: UNO call plays “UNO”; being caught plays “Draw two” (generated via edgeâtts, source in
tools/input_uno.txt, scripttools/gen_sound.py). Other sound effects use Minecraft builtâin sounds. - Interface: lobby (with rules), table leftâbottom “Rules / History” (event log: plays/draws/penalties/UNO calls, player names highlighted, scrollable), settlement screen. Inâtable chat via chat key (default T), returns to game after closing/sending.
đŚ Requirements
| Dependency | Version |
|---|---|
| Minecraft | 1.21.1 |
| Fabric Loader | >= 0.16.0 |
| Fabric API | * (any 1.21.1âcompatible) |
| Java | >= 21 |
đ Installation
- Install Fabric Loader for Minecraft 1.21.1.
- Download this mod jar and Fabric API, place them in your
modsfolder. - Launch the game (singleplayer or multiplayer; the server must also have the mod and Fabric API installed).
đŽ Quick Start
Dou Dizhu:
- Type
/doudizhuto open the lobby. - Create room (choose mode/rule set/announce) or enter a room code to join.
- With 3 players, game starts automatically (for testing:
/doudizhu debug bots 2adds dummy players). - Bid → contest → play cards; you can toggle “Autoâplay” or “Exit” anytime.
Board games (Reversi / Gomoku / Go):
- Type
/chessto open the board lobby. - Choose a game (Go: choose 9 or 19) → Create room, or enter a room code to join; the lobby list shows ongoing games you can spectate.
- With 2 players, game starts automatically (for testing:
/chess debug bots 1adds an AI opponent for Gomoku/Reversi, not for Go). - Click the board to place; you can “Resign” or “Exit” anytime; Go has a “Pass” button.
UNO:
- Type
/unoto open the lobby. - Create room (add 0–9 bots, choose announce) or enter a room code to join.
- The host clicks “Start Game” (needs at least 2 players) to begin.
- Play/draw cards; when you have 1 card left, remember to “Call UNO!”; first to empty hand wins; click “Play again” for a new round.
â¨ď¸ Commands
Dou Dizhu:
| Command | Description | Permission |
|---|---|---|
/doudizhu |
Open lobby; reopen game/settlement screen | all players |
/doudizhu accept <code> |
Join a room (triggered by clickable chat message) | all players |
/doudizhu invite <player> |
Invite a player to your current room | all players (host) |
/doudizhu leave |
Leave room / exit game | all players |
/doudizhu spectate <code> / unspectate |
Spectate / stop spectating | all players |
/doudizhu debug bots <1|2> |
Add debug bots to a waiting room | OP (level 2) |
/doudizhu debug bots remove |
Remove all bots from the room | OP |
/doudizhu debug auto <true|false> |
Toggle autoâplay for yourself (use /execute as @a for all) |
OP |
/doudizhu debug call <0-3> |
Command the current seat to bid (works for real players and bots) | OP |
/doudizhu debug rob <true|false> |
Command the current seat to rob/not rob | OP |
/doudizhu debug play <cardâstring> |
Command the current seat to play specified cards (3-9 T J Q K A 2 X=ĺ°ç D=大ç F=wildcard) | OP |
/doudizhu debug pass |
Command the current seat to pass | OP |
/doudizhu debug forcejoin <player> [code] |
Force a player into a room | OP |
/doudizhu debug trust <0|1|2> <bool> |
Enable/disable autoâplay by seat (no need for online player) | OP |
/doudizhu debug trust <player> <bool> |
Enable/disable autoâplay by player | OP |
/doudizhu debug kick <player> |
Force a player out (seat becomes bot) | OP |
Board games:
| Command | Description | Permission |
|---|---|---|
/chess |
Open lobby; reopen game/settlement | all players |
/chess accept <code> |
Join a room | all players |
/chess invite <player> |
Invite a player | all players (host) |
/chess leave |
Leave room / exit | all players |
/chess spectate <code> / unspectate |
Spectate / stop | all players |
/chess debug bots 1 |
Add AI opponent to waiting room (not for Go) | OP |
/chess debug bots remove |
Remove all bots | OP |
/chess debug move <x> <y> |
Command current seat to move (works for real and bot) | OP |
/chess debug pass |
Command current seat to pass (Go only) | OP |
/chess debug surrender |
Command current seat to resign | OP |
/chess debug forcejoin <player> [code] |
Force join | OP |
/chess debug rooms / room <code> |
List rooms / room details | OP |
/chess debug roomdelete <code> / roomclear |
Delete a room / clear all | OP |
/chess debug kick <player> |
Force exit | OP |
UNO:
| Command | Description | Permission |
|---|---|---|
/uno |
Open lobby; reopen game/settlement | all players |
/uno accept <code> |
Join a room | all players |
/uno invite <player> |
Invite a player | all players (host) |
/uno leave |
Leave room / exit | all players |
/uno start |
Host starts the game (same as lobby button) | all players (host) |
/uno spectate <code> / unspectate |
Spectate / stop | all players |
/uno debug bots <1-9> |
Add debug bots to waiting room | OP |
/uno debug bots remove |
Remove all bots | OP |
/uno debug auto <true|false> |
Toggle autoâplay for yourself | OP |
/uno debug trust <0-9> <bool> |
Enable/disable autoâplay by seat | OP |
/uno debug trust <player> <bool> |
Enable/disable autoâplay by player | OP |
/uno debug forcejoin <player> [code] |
Force join | OP |
/uno debug rooms / room <code> |
List rooms / room details | OP |
/uno debug roomdelete <code> / roomclear |
Delete a room / clear all | OP |
/uno debug kick <player> |
Force exit | OP |
/uno debug spectateui |
Debug spectator UI: generate random virtual snapshot (shows “(Debug)”) | OP |
đ Rules Summary (Dou Dizhu)
- Card ranks: 3 < 4 < … < 10 < J < Q < K < A < 2 < ĺ°ç < 大ç
- Hand types: single / pair / triple / triple+single / triple+pair (not in Folk rules) / straight (≥5) / consecutive pairs (≥3 pairs) / airplane (≥2 groups, with optional wings) / fourâwithâtwo / bomb / rocket (big + small joker)
- Comparison: same type and same count → compare highest rank; fourâwithâtwo cannot be compared with each other; bomb beats any nonâbomb, rocket beats all, bombs compare by rank.
- Wildcard mode: wildcards are jokers that can substitute any card; wildcard + triple = wildcard bomb; triple+pair is forbidden.
- Scoring: base score × multiplier (bombs/rockets/wildcard bombs double immediately). Landlord win: +2×base×multiplier for landlord, each farmer −base×multiplier; loss gives opposite (displayed only for that round, not stored).
- Full rules are available inâgame via the “Rules” screen.

