Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
75a3acd
Add initial support for overworld/end flight
underscore-zi Mar 15, 2025
dd2240a
update to nether-pathfinder api/concurrency changes
babbaj Mar 16, 2025
9d0a4cb
Make usage of the Baritone cache optional for elytra flight
underscore-zi Mar 16, 2025
984c71e
Set a better default Y for elytra GoalXZ
underscore-zi Mar 16, 2025
319aa58
Make sure player is in bounds before attempting elytra pathfinding
underscore-zi Mar 16, 2025
18a6899
Allow landing on bedrock (necessary for nether roof)
underscore-zi Mar 16, 2025
662ba65
Revert "Set a better default Y for elytra GoalXZ"
underscore-zi Mar 16, 2025
c9aa9f7
GoalXZ y-level will consider if player is above nether roof
underscore-zi Mar 24, 2025
b0ba8d3
Rework landing to be safed when descending from high y-levels, and ut…
underscore-zi Mar 24, 2025
1a6c43e
Check negative y landing spots too
underscore-zi Mar 24, 2025
2004a1d
Merge branch 'cabaletta:1.19.4' into 1.19.4
underscore-zi Mar 26, 2025
cf3260c
dynamically change destination y if the roof gets in the way
babbaj Apr 2, 2025
2290801
1.6
babbaj Apr 4, 2025
3fb41ea
memset if no air also cave air is real
babbaj Apr 4, 2025
c7b76bc
custom allocator by default :^)
babbaj Apr 5, 2025
094b3ef
Respect allowAboveRoof roof setting when looking for safe landing spots
underscore-zi Apr 5, 2025
1ea67c2
Allow landing on cobblestone and obsidian
underscore-zi Apr 5, 2025
7feaa51
elytra fixes
babbaj Apr 10, 2025
f3e6116
hold write lock in queueBlockUpdate
babbaj Apr 11, 2025
d0c3aea
Keep zero-based coordinates to within pathfinder code
underscore-zi Apr 12, 2025
75096e1
fix crashes
babbaj Apr 13, 2025
42e1a7a
Merge remote-tracking branch 'origin/1.19.4' into nether-elytra-update
babbaj Apr 13, 2025
470ef10
final
babbaj Apr 13, 2025
0912069
rename elytraUseBaritoneCache
babbaj Apr 13, 2025
20c1631
oops
babbaj Apr 13, 2025
68dc110
fix #elytra reset bypassing y checks
babbaj Apr 15, 2025
04813a8
i forgor to commit this
babbaj Apr 15, 2025
3d5b744
fixes
babbaj Apr 15, 2025
e545294
fix exception when setting out of bounds goal while elytra flying
babbaj Apr 22, 2025
5624d4a
fix deadlock
babbaj Apr 23, 2025
a2784be
Create an interface for elytra pathfinding
underscore-zi Jul 11, 2025
04c4ba2
Add IElytraContextFactory
underscore-zi Jul 11, 2025
0f28075
Implementation of flight above build limit for long distances
underscore-zi Aug 29, 2025
6b3e5f3
Don't use the Sky pathfinder when in the nether and no roof allowed
underscore-zi Aug 29, 2025
248e644
Prevent races between destruction and creation of ElytraBehavior
underscore-zi Aug 29, 2025
94a466b
Prevent deadlock when rapidly changing goals and the solver never get…
underscore-zi Aug 30, 2025
cf91405
Merge remote-tracking branch 'origin/1.19.4' into nether-elytra-update
babbaj Sep 4, 2025
9dce625
Simplify Elytra pathing interface and pull it back out of the public API
underscore-zi Sep 8, 2025
1fb8716
Resolve Codacy style issues
underscore-zi Sep 16, 2025
8613873
Only land if there is a set landing spot
underscore-zi Sep 20, 2025
cd0846c
Persist NetherPathfinderContext through new goals
underscore-zi Oct 8, 2025
4113c16
Unwrap PathCalculationException so it can be handled more efficiently
underscore-zi Oct 10, 2025
2aea9a3
Don't consider a position unloaded if y is beyond the build limit whe…
underscore-zi Oct 17, 2025
901995a
Update FEATURES.md in a more suitable format
LHM056awa Mar 31, 2026
a951efa
Fix formatting in README.md
LHM056awa Mar 31, 2026
91b807d
Update SETUP.md
LHM056awa Mar 31, 2026
b164d07
Fix formatting issues in USAGE.md
LHM056awa Mar 31, 2026
76d6a98
Fix BetterBlockPos leaking into block entity map
mankool0 Apr 20, 2026
f0e87ab
Avoid blocking the thread if the npf write lock is held
underscore-zi Apr 27, 2026
7750a1a
Allow landing spot search to take place across multiple ticks
underscore-zi Apr 27, 2026
62d4b25
Don't block while attempting to solve angles
underscore-zi Apr 27, 2026
0f9f661
Merge pull request #4985 from LHM056awa/FEATURES.md
leijurv May 18, 2026
23df064
Merge branch '1.19.4' into 1.19.4
leijurv May 18, 2026
436828c
Merge pull request #5015 from underscore-zi/1.19.4
leijurv May 18, 2026
aa00526
Merge pull request #5006 from mankool0/1.19.4-betterblockpos-leak-fix
leijurv May 18, 2026
7c74332
Merge pull request #4988 from LHM056awa/USAGE.md
leijurv May 18, 2026
5915280
Merge pull request #4987 from LHM056awa/SETUP.md
leijurv May 18, 2026
9c5db79
Merge pull request #4986 from LHM056awa/README.md
leijurv May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Pathing features

- **Long distance pathing and splicing** Baritone calculates paths in segments, and precalculates the next segment when the current one is about to end, so that it's moving towards the goal at all times.
- **Chunk caching** Baritone simplifies chunks to a compacted internal 2-bit representation (AIR, SOLID, WATER, AVOID) and stores them in RAM for better very-long-distance pathing. There is also an option to save these cached chunks to disk. <a href="https://www.youtube.com/watch?v=dyfYKSubhdc">Example</a>
- **Block breaking** Baritone considers breaking blocks as part of its path. It also takes into account your current tool set and hot bar. For example, if you have a Eff V diamond pick, it may choose to mine through a stone barrier, while if you only had a wood pick it might be faster to climb over it.
Expand All @@ -14,7 +15,8 @@
- **Pigs** It can sort of control pigs. I wouldn't rely on it though.

# Pathing method
Baritone uses A*, with some modifications:

Baritone uses A*, with some modifications:

- **Segmented calculation** Traditional A* calculates until the most promising node is in the goal, however in the environment of Minecraft with a limited render distance, we don't know the environment all the way to our goal. Baritone has three possible ways for path calculation to end: finding a path all the way to the goal, running out of time, or getting to the render distance. In the latter two scenarios, the selection of which segment to actually execute falls to the next item (incremental cost backoff). Whenever the path calculation thread finds that the best / most promising node is at the edge of loaded chunks, it increments a counter. If this happens more than 50 times (configurable), path calculation exits early. This happens with very low render distances. Otherwise, calculation continues until the timeout is hit (also configurable) or we find a path all the way to the goal.
- **Incremental cost backoff** When path calculation exits early without getting all the way to the goal, Baritone it needs to select a segment to execute first (assuming it will calculate the next segment at the end of this one). It uses incremental cost backoff to select the best node by varying metrics, then paths to that node. This is unchanged from MineBot and I made a <a href="https://docs.google.com/document/d/1WVHHXKXFdCR1Oz__KtK8sFqyvSwJN_H4lftkHFgmzlc/edit">write-up</a> that still applies. In essence, it keeps track of the best node by various increasing coefficients, then picks the node with the least coefficient that goes at least 5 blocks from the starting position.
Expand All @@ -27,7 +29,9 @@ Baritone uses A*, with some modifications:
- [Baritone chat control usage](USAGE.md)

# Goals

The pathing goal can be set to any of these options:

- **GoalBlock** one specific block that the player should stand inside at foot level
- **GoalXZ** an X and a Z coordinate, used for long distance pathing
- **GoalYLevel** a Y coordinate
Expand All @@ -38,14 +42,16 @@ The pathing goal can be set to any of these options:

And finally `GoalComposite`. `GoalComposite` is a list of other goals, any one of which satisfies the goal. For example, `mine diamond_ore` creates a `GoalComposite` of `GoalTwoBlocks`s for every diamond ore location it knows of.


# Future features

Things it doesn't have yet

- Trapdoors
- Sprint jumping in a 1x2 corridor

See <a href="https://github.com/cabaletta/baritone/issues">issues</a> for more.

Things it may not ever have, from most likely to least likely =(

- Boats
- Horses (2x3 path instead of 1x2)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Baritone

<p align="center">
<a href="https://github.com/cabaletta/baritone/releases/"><img src="https://img.shields.io/github/downloads/cabaletta/baritone/total.svg" alt="GitHub All Releases"/></a>
</p>
Expand Down Expand Up @@ -111,15 +112,14 @@ Here are some links to help to get started:
# API

The API is heavily documented, you can find the Javadocs for the latest release [here](https://baritone.leijurv.com/).
Please note that usage of anything located outside of the ``baritone.api`` package is not supported by the API release
Please note that usage of anything located outside of the `baritone.api` package is not supported by the API release
jar.

Below is an example of basic usage for changing some settings, and then pathing to an X/Z goal.

```java
BaritoneAPI.getSettings().allowSprint.value = true;
BaritoneAPI.getSettings().primaryTimeoutMS.value = 2000L;

BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ(10000, 20000));
```

Expand Down
13 changes: 10 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ The easiest way to install Baritone is to install it as Forge/Neoforge/Fabric mo
Once Baritone is installed, look [here](USAGE.md) for instructions on how to use it.

## Prebuilt official releases

Releases are made rarely and are not always up to date with the latest features and bug fixes.

Link to the releases page: [Releases](https://github.com/cabaletta/baritone/releases)

The mapping between Minecraft versions and major Baritone versions is as follows

| Minecraft version | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19 | 1.20 | 1.21 | 1.21.4 | 1.21.5 | 1.21.6 - 1.21.8 |
|-------------------|------|------|------|------|------|------|------|------|-------|-------|--------|--------|------------------|
| Baritone version | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 | v1.11 | v1.13 | v1.14 | v1.15 |

Any official release will be GPG signed by leijurv (44A3EA646EADAC6A). Please verify that the hash of the file you download is in `checksums.txt` and that `checksums_signed.asc` is a valid signature by that public keys of `checksums.txt`.
Any official release will be GPG signed by leijurv (44A3EA646EADAC6A). Please verify that the hash of the file you download is in `checksums.txt` and that `checksums_signed.asc` is a valid signature by that public keys of `checksums.txt`.

The build is fully deterministic and reproducible, and you can verify that by running `docker build --no-cache -t cabaletta/baritone .` yourself and comparing the shasum. This works identically on Travis, Mac, and Linux (if you have docker on Windows, I'd be grateful if you could let me know if it works there too).


## Artifacts

Building Baritone will create the final artifacts in the ``dist`` directory. These are the same as the artifacts created in the [releases](https://github.com/cabaletta/baritone/releases).
Expand All @@ -31,6 +32,7 @@ If you want to report a bug and spare us some effort, you want `baritone-unoptim
Otherwise, you want `baritone-standalone-*-VERSION.jar`

Here's what the various qualifiers mean

- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features.
- **Standalone**: Everything is obfuscated. Other mods cannot use Baritone, but you get a bit of extra performance.
- **Unoptimized**: Nothing is obfuscated. This shouldn't be used in production, but is really helpful for crash reports.
Expand All @@ -41,24 +43,27 @@ Here's what the various qualifiers mean
If you build from source you will also find mapping files in the `dist` directory. These contain the renamings done by ProGuard and are useful if you want to read obfuscated stack traces.

## Build it yourself

- Clone or download Baritone

![Image](https://i.imgur.com/kbqBtoN.png)
- If you choose to download, make sure you download the correct branch and extract the ZIP archive.
- Follow one of the instruction sets below, based on your preference

## Command Line

On Mac OSX and Linux, use `./gradlew` instead of `gradlew`.

The recommended Java versions by Minecraft version are

| Minecraft version | Java version |
|-------------------------------|---------------|
| 1.12.2 - 1.16.5 | 8 |
| 1.17.1 | 16 |
| 1.18.2 - 1.20.4 | 17 |
| 1.20.5 - 1.21.8 | 21 |

Download java: https://adoptium.net/
Download java: <https://adoptium.net/>

To check which java version you are using do `java -version` in a command prompt or terminal.

Expand All @@ -75,11 +80,13 @@ and `gradlew build -Pbaritone.forge_build` / `gradlew build -Pbaritone.fabric_bu
for Forge/Fabric instead. And you might have to run `setupDecompWorkspace` first.

## IntelliJ

- Open the project in IntelliJ as a Gradle project
- Refresh the Gradle project (or, to be safe, just restart IntelliJ)
- Depending on the minecraft version, you may need to run `setupDecompWorkspace` or `genIntellijRuns` in order to get everything working

## Github Actions

Most branches have a CI workflow at `.github/workflows/gradle_build.yml`. If you fork this repository and enable actions for your fork
you can push a dummy commit to trigger it and have GitHub build Baritone for you.

Expand Down
12 changes: 6 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Try `#help` I promise it won't just send you back here =)

"wtf where is cleararea" -> look at `#help sel`

"wtf where is goto death, goto waypoint" -> look at `#help wp`
"wtf where is goto death, goto waypoint" -> look at `#help wp`

just look at `#help` lmao

Expand All @@ -33,6 +33,7 @@ Watch this [showcase video](https://youtu.be/CZkLXWo4Fg4)!
To toggle a boolean setting, just say its name in chat (for example saying `allowBreak` toggles whether Baritone will consider breaking blocks). For a numeric setting, say its name then the new value (like `primaryTimeoutMS 250`). It's case insensitive. To reset a setting to its default value, say `acceptableThrowawayItems reset`. To reset all settings, say `reset`. To see all settings that have been modified from their default values, say `modified`.

Commands in Baritone:

- `thisway 1000` then `path` to go in the direction you're facing for a thousand blocks
- `goal x y z` or `goal x z` or `goal y`, then `path` to set a goal to a certain coordinate then path to it
- `goto x y z` or `goto x z` or `goto y` to go to a certain coordinate (in a single step, starts going immediately)
Expand All @@ -47,7 +48,7 @@ Commands in Baritone:
- `build` to build a schematic. `build blah.schematic` will load `schematics/blah.schematic` and build it with the origin being your player feet. `build blah.schematic x y z` to set the origin. Any of those can be relative to your player (`~ 69 ~-420` would build at x=player x, y=69, z=player z-420).
- `schematica` to build the schematic that is currently open in schematica
- `tunnel` to dig and make a tunnel, 1x2. It will only deviate from the straight line if necessary such as to avoid lava. For a dumber tunnel that is really just cleararea, you can `tunnel 3 2 100`, to clear an area 3 high, 2 wide, and 100 deep.
- `farm` to automatically harvest, replant, or bone meal crops. Use `farm <range>` or `farm <range> <waypoint>` to limit the max distance from the starting point or a waypoint.
- `farm` to automatically harvest, replant, or bone meal crops. Use `farm <range>` or `farm <range> <waypoint>` to limit the max distance from the starting point or a waypoint.
- `axis` to go to an axis or diagonal axis at y=120 (`axisHeight` is a configurable setting, defaults to 120).
- `explore x z` to explore the world from the origin of x,z. Leave out x and z to default to player feet. This will continually path towards the closest chunk to the origin that it's never seen before. `explorefilter filter.json` with optional invert can be used to load in a list of chunks to load.
- `invert` to invert the current goal and path. This gets as far away from it as possible, instead of as close as possible. For example, do `goal` then `invert` to run as far as possible from where you're standing at the start.
Expand All @@ -67,6 +68,7 @@ Commands in Baritone:
All the settings and documentation are <a href="https://github.com/cabaletta/baritone/blob/master/src/api/java/baritone/api/Settings.java">here</a>. If you find HTML easier to read than Javadoc, you can look <a href="https://baritone.leijurv.com/baritone/api/Settings.html#field.detail">here</a>.

There are about a hundred settings, but here are some fun / interesting / important ones that you might want to look at changing in normal usage of Baritone. The documentation for each can be found at the above links.

- `allowBreak`
- `allowSprint`
- `allowPlace`
Expand All @@ -86,12 +88,10 @@ There are about a hundred settings, but here are some fun / interesting / import
- `mineScanDroppedItems`
- `allowDiagonalAscend`




# Troubleshooting / common issues

## Why doesn't Baritone respond to any of my chat commands?

This could be one of many things.

First, make sure it's actually installed. An easy way to check is seeing if it created the folder `baritone` in your Minecraft folder.
Expand All @@ -101,7 +101,7 @@ Second, make sure that you're using the prefix properly, and that chat control i
For example, Impact disables direct chat control. (i.e. anything typed in chat without a prefix will be ignored and sent publicly). **This is a saved setting**, so if you run Impact once, `chatControl` will be off from then on, **even in other clients**.
So you'll need to use the `#` prefix or edit `baritone/settings.txt` in your Minecraft folder to undo that (specifically, remove the line `chatControl false` then restart your client).


## Why can I do `.goto x z` in Impact but nowhere else? Why can I do `-path to x z` in KAMI but nowhere else?

These are custom commands that they added; those aren't from Baritone.
The equivalent you're looking for is `goto x z`.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ forge_version=45.0.43

fabric_version=0.14.11

nether_pathfinder_version=1.4.1
nether_pathfinder_version=1.6

// These dependencies are used for common and tweaker
// while mod loaders usually ship their own version
Expand Down
30 changes: 30 additions & 0 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,36 @@ public final class Settings {
*/
public final Setting<Boolean> elytraChatSpam = new Setting<>(false);

/**
* May reduce memory usage by using a custom allocator for pathfinding
*/
public final Setting<Boolean> elytraCustomAllocator = new Setting<>(true);

/**
* Allow the pathfinder to attempt flight in tighter spaces, useful in caves but can be dangerous.
*/
public final Setting<Boolean> elytraAllowTightSpaces = new Setting<>(false);

/**
* Allow the pathfinder to fly above y 128 in the nether.
*/
public final Setting<Boolean> elytraAllowAboveRoof = new Setting<>(false);

/**
* Allow the pathfinder to access the baritone cache to improve pathing
*/
public final Setting<Boolean> elytraUseCache = new Setting<>(true);

/**
* Allow the pathfinder to fly above the build limit in the overworld and end.
*/
public final Setting<Boolean> elytraAllowAboveBuildLimit = new Setting<>(true);

/**
* Minimum distance in blocks of an elytra trip before the pathfinder will try to fly above build limit. (Minimum: 32). Requires {@link #elytraAllowAboveBuildLimit} to be enabled.
*/
public final Setting<Integer> elytraLongDistanceThreshold = new Setting<>(500);

/**
* Sneak when magma blocks are under feet
*/
Expand Down
4 changes: 4 additions & 0 deletions src/api/java/baritone/api/utils/RotationUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ public static Optional<Rotation> reachable(IPlayerContext ctx, BlockPos pos, dou
}

public static Optional<Rotation> reachable(IPlayerContext ctx, BlockPos pos, double blockReachDistance, boolean wouldSneak) {
// Prevent BetterBlockPos from leaking into Minecraft's block entity map
if (pos instanceof BetterBlockPos) {
pos = new BlockPos(pos.getX(), pos.getY(), pos.getZ());
}
if (BaritoneAPI.getSettings().remainWithExistingLookDirection.value && ctx.isLookingAt(pos)) {
/*
* why add 0.0001?
Expand Down
4 changes: 4 additions & 0 deletions src/api/java/baritone/api/utils/VecUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ private VecUtils() {}
* @see #getBlockPosCenter(BlockPos)
*/
public static Vec3 calculateBlockCenter(Level world, BlockPos pos) {
// Prevent BetterBlockPos from leaking into Minecraft's block entity map
if (pos instanceof BetterBlockPos) {
pos = new BlockPos(pos.getX(), pos.getY(), pos.getZ());
}
BlockState b = world.getBlockState(pos);
VoxelShape shape = b.getCollisionShape(world, pos);
if (shape.isEmpty()) {
Expand Down
Loading
Loading