Villager Connect Four

Play Connect Four against villagers! A button on the trade screen starts a full game - their skill scales with trading level, and because the villager drops first, a Master has solved the game and cannot be beaten.
Back to Files

Villager Connect Four 0.1.0

File namevillagerconnectfour-0.1.0.jar
Uploaded
Jul 26, 2026
Downloads
9
Size
68.7 KB
Mod Loaders
Fabric
File ID
8515012
Type
R
Release
Supported game versions
  • 26.2

Curse Maven Snippet

Fabric

modImplementation "curse.maven:villager-connect-four-1626494:8515012"

Learn more about Curse Maven

What's new

0.1.0 — Initial release

Added

  • Connect Four button on every villager's trade screen — challenge any villager to a full game.
  • The villager drops first, and plays yellow. Connect Four is a solved game: on the standard 7×6 board whoever moves first can force a win. Giving the villager that side is what makes the top of the difficulty ladder a genuine wall rather than merely a strong opponent, and it is the one place this mod deliberately departs from its Villager Chess and Villager Checkers siblings.
  • Difficulty scales with the villager's trading level, and each level thinks differently rather than just deeper: Novice drops almost at random → Apprentice takes the win in front of it and blocks yours → Journeyman never plays into a loss and works with double threats → Expert understands odd/even threat parity → Master has solved the game.
  • first-player=player in config/villagerconnectfour.properties hands you the first move and therefore the theoretically winning side — the sanctioned way past an unbeatable Master. Your colour follows the turn order, so this also makes you yellow.
  • board-size accepts boards from 4x4 up to 8x7. Sizes other than 7×6 change the game's value rather than just its scale — several smaller boards are draws with perfect play, so a Master can be held on them.
  • Column-based input with a ghost disc hanging over the column under the cursor, discs that fall and settle, and a full column that flashes red with a dull note rather than silently ignoring the click.
  • The winning four are outlined and the rest of the board dims, so a win is visible rather than inferred.
  • Losing to a Master while it has the first move explains itself: the end banner points at the first-player setting instead of leaving the defeat looking arbitrary.
  • Abandon handling: walking more than 16 blocks away, the villager dying, or disconnecting abandons the game; closing the board resigns.
  • From-scratch pure-Java engine (negamax + alpha-beta + iterative deepening) running on a background thread, built on two bitboards packed into a single long with a sentinel row per column so four-in-a-row is found by shift-and with no edge masking.
  • Scores are measured in discs on the board rather than plies from the search root, which makes them absolute facts about a position — so one transposition table is shared by every game on the server and a Master's knowledge compounds across a game instead of starting cold each move.
  • Fully server-authoritative: the server owns all game state; clients send a column and nothing else.
  • Board, discs, holes and highlights are drawn procedurally rather than from a sprite sheet, so the board stays crisp at every size and the mod ships no textures.
  • The trade-screen button stacks below other Villager Games mods' buttons instead of overlapping them, and sizes itself to its label.

This mod has no additional files