Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

How do I build for a specific version of minecraft?

xiaodown opened this issue · 16 comments

commented

What do you need help with?

Hey Leijurv.

Current version works with 1.21.3 - but if I want to build for 1.21.1, how can I do that? (or somehow modify the build to force it to ignore the version restrictions)?

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
commented

There is a (unmaintained and slightly outdated) 1.20.1 branch you can build from. If you need more recent changes on 1.21.1 you'll need to look into the changes made when updating from 1.21.1 to 1.21.3 and revert them (locally).

commented

(I tried unpacking the jar and editing neoforge.mods.toml, then rezipping it, but that didn't work)

commented
commented

Ok, yeah, there is actually a 1.21.1 branch (https://github.com/cabaletta/baritone/tree/1.21.1), and I've tried building it, but without much success - both using powershell and using an ubuntu VM. But I'm only a gradle novice, so ...maybe i'll try the other branch.

commented

Ok, yeah, there is actually a 1.21.1 branch (https://github.com/cabaletta/baritone/tree/1.21.1), and I've tried building it, but without much success - both using powershell and using an ubuntu VM. But I'm only a gradle novice, so ...maybe i'll try the other branch.

Make sure you are using java 17

commented

Use adoptium, and get x64 jdk. If that doesn’t work I’ll send you a download link.

commented

Gooooooood call, I've been trying with various versions of java. Is there a preference between oracle / openjdk?

commented

Sigh, I wish I understood what I'm doing wrong.

* What went wrong:
A problem occurred configuring project ':forge'.
> Failed to notify project evaluation listener.
   > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=21, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
      > No locally installed toolchains match and toolchain download repositories have not been configured. 

that's very indicative of the problems I've been having. And I'm using the adoptium java 17:

 # java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment Temurin-17.0.13+11 (build 17.0.13+11)
OpenJDK 64-Bit Server VM Temurin-17.0.13+11 (build 17.0.13+11, mixed mode, sharing) 

(and this is a fresh ubuntu 22.04LTS vm I spun up just to compile this).

commented

I got it to compile using temurin jdk21 but it crashes minecraft. Here was my process:

git clone https://github.com/cabaletta/baritone.git
apt-get update; apt-get dist-upgrade
apt-get install -y wget apt-transport-https gnupg
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt-get update
apt-get install temurin-21-jdk
java --version
cd baritone/
git fetch; git switch 1.21.1
./gradlew build

That succeeds (fresh ubuntu 22.04) but the output jar doesn't work :(.

commented

Build also succeeds for me with the 1.21 branch + temurin jdk21, and editing the neoforge meta to support 1.21.1, but still crashes blockgame :/. Sigh, I feel so dumb.

commented

I’ll send the link when I’m home

commented

Thank you so much, man. I apologize for being helpless. I wish I knew more and didn't have to bug kind strangers.

commented

Oh you got it finished?

commented

no, sorry. I am able to get the gradle build to work and output jars, using various branches and various versions of java, but every one i've managed to build crashes minecraft.

commented

@PizzaGod873 If you do have a 1.21.1 jar that works, I'd really love a download link. Apologies for bugging you, but I have had no luck.

commented

You can also enable GitHub Actions on your repository and trigger the build workflow on the branch you want by pushing a dummy commit.