unmojang / drasl

Yggdrasil-compatible API server for Minecraft
GNU General Public License v3.0
69 stars 11 forks source link

Document how to use with Minecraft Console Client #66

Open TechClusterHQ opened 2 months ago

TechClusterHQ commented 2 months ago

Since PR #2611, MCC has support for adding custom yggdrasil servers. Because one of the best uses of this server is creating more accounts for bots, I'd like to use my custom auth server with MCC. Setting AccountType and AuthServer to the values results in a "Network Error" on the MCC side an a 404 on the Drasl side:

{"time":"2024-04-28T07:43:37.836718975Z","id":"","remote_ip":"xxxxx","host":"mca.xxxxx.com","method":"POST","uri":"/api/yggdrasil/authserver/authenticate","user_agent":"MCC/1.20.4","status":404,"error":"code=404, message=Not Found","latency":39509,"latency_human":"39.509µs","bytes_in":246,"bytes_out":50}

Configuration:

AccountType = "yggdrasil"                   # Account type: "mojang" OR "microsoft" OR "yggdrasil". Also affects interactive login in console.
Method = "mcc"                              # Microsoft Account sign-in method: "mcc" OR "browser". If the login always fails, please try to use the "browser" once.
AuthServer = { Host = "mca.xxxxx.com", Port = 443 } # Yggdrasil authlib server domain name and port.

Since you mentioned in the README that working with bots is a primary use case for this project it'd be great if usage with MCC could be documented or if you could let me know how.

TechClusterHQ commented 2 months ago

I tried setting it up using mineflayer and couldn't get that to work either, do you know how that works as well?

evan-goode commented 2 months ago

Thanks for filing this!

I looked into MCC, and their implementation of Yggdrasil is incorrect. The request paths get prefixed with /api/yggdrasil/authserver or /api/yggdrasil/sessionserver. Blessing Skin (used by LittleSkin) structures their API like that [1], but other Yggdrasil implementations including Mojang's, Ely.by, and Drasl do not. I can try to fix MCC and file a PR, which would be straightforward unless they care about keeping backwards compatibility with the (incorrect) implementation.

And I just opened https://github.com/unmojang/drasl/pull/69 to document Mineflayer, that's what I have been writing bots with. While writing that documentation, I ran into a bug that I fixed in #68, so try updating Drasl to the latest master commit if it's not working for you still.

As I wrote in https://github.com/unmojang/drasl/pull/69, enforce-secure-profile=true servers will not work yet with Mineflayer due to a limitation on their end, see https://github.com/unmojang/drasl/issues/67.

[1] https://github.com/bs-community/yggdrasil-api