Minecraft Agent

A Kotlin library for Minecraft 26.3 bots: pathfinding, navigation and game skills. Every public API is callable from Java.

Cruises the End with elytra and rockets Parkour jumps Bridges gaps Rides a horse up ledges

Libraries

net.ccbluex:minecraft-agent-<library> from https://maven.ccbluex.net/snapshots. Each library brings the ones it builds on.

Platforms

Client

The local player as a body: client-common for every mod loader, client-fabric for Fabric mods.

dependencies {
    implementation("net.ccbluex:minecraft-agent-client-fabric:1.0.0-SNAPSHOT")
    // Jar-in-jar is not transitive: every module goes into the mod jar
    for (module in listOf("world", "simulation", "pathfinder", "navigation", "vanilla", "client-common", "client-fabric")) {
        include("net.ccbluex:minecraft-agent-$module:1.0.0-SNAPSHOT")
    }
}
defineGameTypes()   // once the game's registries are loaded, before any other library call
val navigation = ClientNavigation()
navigation.navigator.moveTo(Vec3(100.5, 64.0, -20.5)) { ending -> println(ending) }

Server

Bots as players on the server: server-common for every server platform, server-paper as a Paper plugin with minigame support, server-legacy as a Spigot 1.8.8 plugin. Install the MinecraftAgent plugin jar on the server, or shade server-paper or server-legacy into a plugin with bots of its own, which starts them with MinecraftAgent.start(this) and, for minigames on Paper, Games.start (in a host plugin).

dependencies {
    compileOnly("net.ccbluex:minecraft-agent-server-paper:1.0.0-SNAPSHOT")
}
val bot = MinecraftAgent.bots().spawn(location, "Steve")
bot.moveTo(target, 1.0)

SKILL.md covers the rest: game modes, options and the Kotlin coroutine API.

Yes: passes its game test or worked in a captured run. Untested: should work, never run there. No: not supported yet.

Walking

Client Server
Walks around walls Yes Yes Walks around walls
Tunnels through walls Yes Untested Tunnels through walls
Bridges gaps Yes Yes Bridges gaps
Pillars up Yes Untested Pillars up
Opens doors and fence gates Yes Untested Opens doors and fence gates
Keeps off soul sand, crosses ice Yes Untested Keeps off soul sand, crosses ice
Takes another way when its way gets closed Yes Untested Takes another way when its way gets closed
Climbs ladders and vines Yes Untested Climbs ladders and vines
Crouches through low gaps, safe walk on narrow bridges Yes Untested Crouches through low gaps, safe walk on narrow bridges
Swims through flooded tunnels Yes Untested Swims through flooded tunnels

Jumping

Client Server
Parkour jumps Yes Untested Parkour jumps
Assists jumps the player starts Yes Untested Assists jumps the player starts
Jumps from the very edge Yes Untested Jumps from the very edge

Following

Client Server
Walks where the camera faces, to a goal, and after a player Yes Untested Walks where the camera faces, to a goal, and after a player
Walks to far goals in stages Yes Untested Walks to far goals in stages

Flying and riding

Client Server
Flies with an elytra Yes Untested Flies with an elytra
Cruises the End with elytra and rockets Yes Untested Cruises the End with elytra and rockets
Flies through a canyon in creative Yes No Flies through a canyon in creative
Flies over a wall in creative Yes No Flies over a wall in creative
Rides a boat Yes Untested Rides a boat
Rides a horse up ledges Yes Untested Rides a horse up ledges
Takes teleport routes No Untested

Agent usage

Most of this code was written by AI models. Each declaration they wrote names its model in an @agent KDoc tag. These are all models used so far and what they cost, summed up by agent-usage:

AI models used in Minecraft Agent and their cost

Commits

type(scope): subject, lowercase, no trailing period.

feat fix refactor chore docs

License

This project is subject to the GNU General Public License v3.0 (GPLv3). This only applies to source code located directly in this clean repository. During the development and compilation process, additional source code may be used to which we have obtained no rights. Such code is not covered by the GPL license.

For those who are unfamiliar with the license, here is a summary of its main points. This is by no means legal advice nor legally binding.

Actions that you are allowed to do:

If you do decide to use ANY code from the source: