Connects to a Lichess game in Minecraft by sending a challenge request to a hardcoded opponent. The board is reflected via mobs on a Minecraft recreation of a chess board with pieces being different mobs. Each turn, a sign GUI comes up asking you to input a move which updates the Lichess board as well as the Minecraft board.
- Create a 1.20.2 Spigot Minecraft server (see here)
- Import this world or create your own world where, at coordinates (0.5, -60, -0.5), you build an 8x8 chess board where that coordinate is the bottom left corner of the board.
- Create a lichess bot account - instructions here (creating API token + running
curlcommand to upgrade to bot account) IMPORTANT: note down the API token - Clone repository
- In
LiboardMC.java, at line11, replace with your API access token created in step 3 - In
StartCommand.java, at line22, replace the preset username(mattman23)with the username to challenge - the person you will be playing against from Minecraft - In
pom.xml, at line43, replace the outputFile path with the path of yourpluginsfolder with the server created in step 1 - Run maven lifecycle
package, which will generate .jar plugin file in yourpluginsfolder - Run the server, connect, and do
/startin game to create the challenge request - When accepted, you will automatically play the opening
1. e4simply because I couldn't be bothered to be able to change the first move you do. Then you will have to wait for the person you're playing against to make a move. - Once they have made a move, a sign GUI will come up in game, and you have to enter your move. IMPORTANT: the notation for this is different to normal algebraic chess notation! You put the source square, then destination square e.g.
e2e4,a1a3, so DO NOT put the name of the piece. As long as it is valid, the relevant piece will be moved. If you put an invalid move, because there is no error handling you will not be given another opportunity to make a move and you will have to restart the game. - Continue playing until mate! (there is no handling for resignations, draws, etc. Didn't get a chance in the time frame!). You will get a message in game if you get mated but it will not update the move as we forgot to check for this. Oops.