Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21 support #3406

Closed
PERRETJonatan opened this issue Jun 23, 2024 · 29 comments
Closed

1.21 support #3406

PERRETJonatan opened this issue Jun 23, 2024 · 29 comments
Labels
new feature Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@PERRETJonatan
Copy link

PERRETJonatan commented Jun 23, 2024

Describe the solution you'd like

Add the 1.21 support to mineflayer

Describe alternatives you've considered

I tried changing the accepted versions in some files but i got some errors
I saw on the node-minecraft-protocol that we need to wait for the 1.20.5 and 1.20.6 to be added so i guess we just need to wait

@PERRETJonatan PERRETJonatan added new feature Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jun 23, 2024
@gonzabb14
Copy link

Any update?

@rom1504 rom1504 mentioned this issue Jul 2, 2024
@rom1504
Copy link
Member

rom1504 commented Jul 2, 2024

See #3405

@GrittyGizmo
Copy link

Just switch to writing bots in Fabric, their API is better, and you can probably learn Java in less time than it takes Mineflayer on average to update for a minor Minecraft version.

The project owners of Mineflayer have all but abandoned the project from what I can tell. They haven't really cared about keeping it updated for latest MC version for years.
The project isn't dead yet, because a few people are still stuck with it as a dependency for their old legacy projects, so there's a small community of user-sourced contributors who will sometimes update it. But usually by the time Mineflayer updates to the current version, Minecraft itself is already on their next update.

@PERRETJonatan
Copy link
Author

PERRETJonatan commented Jul 5, 2024

well, i didn't know you can write bot in Fabric, like is it a mod that you install on a fabric client ?

I liked the Mineflayer thing because it was very light weight and didn't have to render the game. For that, there is the console-client in C#, but it's not updated yet.

@extremeheat
Copy link
Member

extremeheat commented Jul 5, 2024

a small community of user-sourced contributors

Yes, that's how open source projects work. PrismarineJS is not a company and does not hire anyone to work for the organization. It's a fully volunteer driven effort, and changes to code will only be made when someone was able to, and willing on their own accord, to write the needed code changes and open a PR to upstream their changes.

If you would like a specific change then you can...

  1. Open an issue in upstream (if it doesn't already exist)
  2. Make the changes yourself and PR or contribute to existing work (if it exists)
  3. See if there are other ways you can incentivize others to make the desired change (we have GitHub sponsors, if you'd like to put a bounty on an issue you can state your intention to do so, open to anyone to claim it)

You are of course welcome to use whatever tooling you want, there's no competition here. But being rude and entitled on volunteer projects about them not coding what you want them to on your timeline isn't nice. The people here generously taking time out of their days to work on and maintain software you get to use for free don't deserve to hear that, it's not incentivizing anything.

@rom1504
Copy link
Member

rom1504 commented Jul 5, 2024

The project owners of Mineflayer have all but abandoned the project from what I can tell. They haven't really cared about keeping it updated for latest MC version for years.

Why the lies? Do you have financial interests into Fabric?

@zakarka2006
Copy link

well, i didn't know you can write bot in Fabric, like is it a mod that you install on a fabric client ?

I guess so, but it would be nice to run the bot without the game window or somehow just in the background

@TheyCallMeLinux
Copy link

I'm eagerly anticipating the 1.21 update! A big thank you to the development team for bringing this fantastic project to life.

@y3621555
Copy link

What time can update 1.21, please I very need this value.

@rom1504
Copy link
Member

rom1504 commented Jul 30, 2024 via email

@rom1504
Copy link
Member

rom1504 commented Jul 30, 2024

You can start by helping there PrismarineJS/minecraft-data#898 ; read the latest comment for more info

@hirun1228
Copy link

i dont understand. how do i help?

@SonicandTailsCD
Copy link

You can help by writing and publishing code to implement support for 1.21! :)

@BF5258
Copy link

BF5258 commented Sep 26, 2024

But usually by the time Mineflayer updates to the current version, Minecraft itself is already on their next update.

🤣 True. Minecraft Live is in two days. Soon players will be asking for 1.22 support.

@rom1504
Copy link
Member

rom1504 commented Sep 26, 2024

Imagine how fast we would get 1.22 support if all the users in this issue spent 1h per day to contribute

@BF5258
Copy link

BF5258 commented Sep 26, 2024

Imagine how fast we would get 1.22 support if all the users in this issue spent 1h per day to contribute

Good idea! How can I help?

@rom1504
Copy link
Member

rom1504 commented Sep 26, 2024

@GenerelSchwerz
Copy link
Contributor

I'm not sure if I should be doing this tbh, but as a temporary stopgap, you can use my plugin:

https://github.com/GenerelSchwerz/mineflayer-viaproxy

I am not sending this in any attempt to dissuade people from contributing to 1.21, but for those who believe they are unable to contribute to updating 1.21, this can be used as a replacement.

@Blue-Kod
Copy link

You can use ViaBackwards on server, and Version argument in bot start:
bot = mineflayer.createBot({
'host': 'gn1.slicehosting.tech',
'port': 27527,
'username': BOT_USERNAME,
'version': '1.12'
})
But some blocks and features will not work.

@MightyPiggie
Copy link

MightyPiggie commented Oct 4, 2024

It seems the current failing exampleBee test case is not really failing?

I noticed it was trying to connect to the 1.20.5 server as a 1.20.6 client (I am still not sure why it does this). After setting version: '1.20.5' in the example file for all the exampleX tests it passes.

After which the raytrace starts to fail. This one seems to be a bit weird as well. Because when I just run that case it passed. I suspect the bot isn't reset as it should. Because the reason it failed is because it was starring at bedrock, while it should be nothing/NULL according to the test case.

The only remaining test case that is failing for sure is the trade one. But this one I haven't been able to figure out why.

Current error message it gives is:
Chunk size is 155 but only 132 was read ; partial packet : {"name":"trade_list","params":{"windowId":1,"trades":[{"inputItem1":{"itemCount":-91,"itemId":6,"addedComponentCount":1,"removedComponentCount":0,"components":[{"type":"max_stack_size","data":1111}],"removeComponents":[]},"outputItem":{"itemCount":0},"inputItem2":{"itemCount":0},"tradeDisabled":false,"nbTradeUses":0,"maximumNbTradeUses":16777216,"xp":201326592,"specialPrice":33554431,"priceMultiplier":-3.9316069277524514e+36,"demand":-855638016},{"inputItem1":{"itemCount":60,"itemId":805,"addedComponentCount":1,"removedComponentCount":0,"components":[{"type":"max_stack_size","data":854}],"removeComponents":[]},"outputItem":{"itemCount":0},"inputItem2":{"itemCount":0},"tradeDisabled":true,"nbTradeUses":-687341312,"maximumNbTradeUses":0,"xp":16777216,"specialPrice":201326592,"priceMultiplier":2.350988701644575e-38,"demand":0},{"inputItem1":{"itemCount":0},"outputItem":{"itemCount":0},"inputItem2":{"itemCount":0},"tradeDisabled":false,"nbTradeUses":10814977,"maximumNbTradeUses":113665,"xp":0,"specialPrice":1,"priceMultiplier":1.6815581571897805e-44,"demand":1},{"inputItem1":{"itemCount":0},"outputItem":{"itemCount":0},"inputItem2":{"itemCount":0},"tradeDisabled":false,"nbTradeUses":0,"maximumNbTradeUses":0,"xp":-1526333184,"specialPrice":28378624,"priceMultiplier":1.4816629312538453e-40,"demand":16777216}],"villagerLevel":0,"experience":0,"isRegularVillager":true,"canRestock":false}}; buffer :2d0104a506010001d70800000000000000010000000c00000001fffffffc3d4ccccd0000003ca506010001d606000001d708010000000000010000000c00000001000000000000000000000000a506010001bc0100000000000000010000000c00000001000000000000000000000000a506010001b1060000019d07010000000000010000000c0000000100000000000000000000000001000101

I am not really experienced with Javascript so I am not sure if I am looking into the right direction. If anyone knows why it is failing I would love to know how you found it out. Maybe I will be able to help a bit more next time :)

@MightyPiggie
Copy link

I dove a bit deeper today. When using the villager in the trade.js I get the following packed back:
{ "name": "trade_list", "params": { "windowId": 1, "trades": [ { "inputItem1": { "itemCount": 805, "itemId": 1, "addedComponentCount": 0, "removedComponentCount": 1, "components": [], "removeComponents": [ { "type": 1111 } ] }, "outputItem": { "itemCount": 0 }, "inputItem2": { "itemCount": 0 }, "tradeDisabled": false, "nbTradeUses": 0, "maximumNbTradeUses": 16777216, "xp": 201326592, "specialPrice": 33554431, "priceMultiplier": -3.9316069277524514e+36, "demand": -855638016 }, { "inputItem1": { "itemCount": 60, "itemId": 805, "addedComponentCount": 1, "removedComponentCount": 0, "components": [ { "type": "max_stack_size", "data": 854 } ], "removeComponents": [] }, "outputItem": { "itemCount": 0 }, "inputItem2": { "itemCount": 0 }, "tradeDisabled": true, "nbTradeUses": -687341312, "maximumNbTradeUses": 0, "xp": 16777216, "specialPrice": 201326592, "priceMultiplier": 2.350988701644575e-38, "demand": 0 }, { "inputItem1": { "itemCount": 0 }, "outputItem": { "itemCount": 0 }, "inputItem2": { "itemCount": 0 }, "tradeDisabled": false, "nbTradeUses": 10814977, "maximumNbTradeUses": 113665, "xp": 0, "specialPrice": 1, "priceMultiplier": 1.6815581571897805e-44, "demand": 1 }, { "inputItem1": { "itemCount": 0 }, "outputItem": { "itemCount": 0 }, "inputItem2": { "itemCount": 0 }, "tradeDisabled": false, "nbTradeUses": 0, "maximumNbTradeUses": 0, "xp": -1526333184, "specialPrice": 28378624, "priceMultiplier": 1.4816629312538453e-40, "demand": 16777216 } ], "villagerLevel": 0, "experience": 0, "isRegularVillager": true, "canRestock": false } }

Whats strange is that the itemCount and itemId are flipped for the inputItem1. Because the villager is asking for a emerald, which has Id 805, but according to the packed the itemId is 1.

The missing bytes is most likely because of the outputItem being empty, which should be filled with 1111 as itemId (pumpkin_pie). So I guess something is missing in the protocol. I am not sure why yet.

@rom1504
Copy link
Member

rom1504 commented Oct 5, 2024 via email

@MightyPiggie
Copy link

Check the definition of the packet providing that data. Sounds like some fields are missing there

Yep I assumed the same. But as far as I can see nothing is missing.

@MightyPiggie
Copy link

I decompiled the 1.20.5 server jar and as far as my knowledge goes it should be correct. But I also didn't understand everything correctly in the code so it could be that I am wrong. I am truly at a dead end for me.

@extremeheat
Copy link
Member

Best to comment issues with PR (#3412 ?) in the PR not this issue so it's easier to track where problems are

1.20.5 and 1.20.6 are protocol compatible, so they have the same protocol version. Since node Minecraft protocol resolves data by protocol version it will default to data from the top versionsByProtocol[version][0] version when loading data (yielding 1.20.6). This shouldn't be a problem since I added a data path mapping in mcdata for 1.20.6->1.20.5.

The item data format over the network changed so item handling may need to change.

@rom1504
Copy link
Member

rom1504 commented Oct 13, 2024

we have 1.20.6 now

help wanted for 1.21

@rom1504 rom1504 pinned this issue Oct 13, 2024
@kittenvr
Copy link

is there a roadmap or checklist?

@Felitendo
Copy link

@rom1504
Copy link
Member

rom1504 commented Oct 26, 2024

done, thanks to @extremeheat @GroobleDierne @Madlykeanu @SuperGamerTron

@rom1504 rom1504 closed this as completed Oct 26, 2024
@rom1504 rom1504 unpinned this issue Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests