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

Eating golden apple/drinking potion while the food is full #1251

Open
metroyanno opened this issue Aug 16, 2020 · 9 comments
Open

Eating golden apple/drinking potion while the food is full #1251

metroyanno opened this issue Aug 16, 2020 · 9 comments
Labels
new feature Stage2 promising idea, but needs more thinking before implementation

Comments

@metroyanno
Copy link

Versions

  • mineflayer: 2.28.1
  • server: spigot
  • node: 14.4.0

Detailed description of a problem

The script throws an exception "Error: Food is full" if I'm trying to make bot drink or use potion and the food is full.

Your current code

bot.on('chat', function (username, message) {
    if (username === bot.username) return
    bot.chat(message)
    bot.consume(console.log)
})

Expected behavior

Drink/eat everything except food if even the food is full.

@TheDudeFromCI
Copy link
Member

Oh? Golden apples can be eaten with full hunger? I knew corus fruit can, but I thought that was the only one. Good to know.

Maybe a flag can be added to Minecraft-Data to check if the food can be eaten with full hunger or not. We could just check they flag when eating before throwing the error.

@rom1504
Copy link
Member

rom1504 commented Aug 16, 2020 via email

@metroyanno
Copy link
Author

This should put an err in the callback at worse, not assert

It's actually a callback err, I just logged it to console

@TheDudeFromCI
Copy link
Member

Yeah, just confirmed. It is a standard callback error.

Screenshot_20200816-041108.png

@rom1504
Copy link
Member

rom1504 commented Aug 16, 2020 via email

@TheDudeFromCI
Copy link
Member

Yeah, should be pretty simple. Just need to store that data in MC-Data, first.

@Karang
Copy link
Contributor

Karang commented Aug 17, 2020

Alternatively, to solve this issue, you can already use bot.activateItem() with the gapple equiped to consume it without the food check.

@TheDudeFromCI
Copy link
Member

While that's true, it doesn't keep track of eat time like consume does.

@rom1504 rom1504 added new feature Stage2 promising idea, but needs more thinking before implementation and removed possible bug labels Jan 31, 2021
@romtec123
Copy link

Has there been any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Stage2 promising idea, but needs more thinking before implementation
Projects
None yet
Development

No branches or pull requests

5 participants