Comments (3)
So, I did a little tinkering here and there, and I was analyzing the packets being sent directly and I ended up realizing that the server is sending as expected, so much so that when I pull it directly using this method:
bot._client.on('window_items', (window) => {
console.log(window)
})
it is possible to see the items that when pulled by the "Window" return of event "WindowOpen", appear only as null
from mineflayer.
This is not valid javascript:
bot.activateItem(offHand=false)
What this is doing is declaring an offHand
variable in the global scope, as it's not pre-defined with var or let within the current scope, and then that's being passed to the function. Also, activateItem returns a promise that you must await.
I don't understand what you mean here: "However, the slots in the window returned by the Event are only those of the inventories and not of the chest itself."
Where is the expected output coming from? Are you saying it's returning the bot inventory or one half of the chest?
You can log a full object without truncation by using console.dir(obj, { depth: null })
from mineflayer.
This is not valid javascript:
bot.activateItem(offHand=false)What this is doing is declaring an
offHand
variable in the global scope, as it's not pre-defined with var or let within the current scope, and then that's being passed to the function. Also, activateItem returns a promise that you must await.I don't understand what you mean here: "However, the slots in the window returned by the Event are only those of the inventories and not of the chest itself."
Where is the expected output coming from? Are you saying it's returning the bot inventory or one half of the chest?
You can log a full object without truncation by using
console.dir(obj, { depth: null })
As can be seen in the previous messages and prints, whenever the bot interacts with the "Compass" item, it opens a Windows, as if it were a Chest, but, when I receive the event using the WindowOpen, it only shows the items that are present in the inventory and not those that should be in the "Chest"
But if I receive it directly, using the "window_items" event from minecraft-protocol, it already shows these items as can be seen below
from mineflayer.
Related Issues (20)
- Multiple Bots crash HOT 1
- pickRealm silently fails to connect HOT 3
- bot.sleep() can make memory leak
- Error: Can't find potato in slots [54 - 90], (item id: 1091) HOT 1
- React to a message sent by the server without username HOT 3
- Attacking on Pre Motion instead of Post. HOT 3
- Error: Event windowOpen did not fire within timeout of 20000ms HOT 1
- villager trade() improvement request
- TypeError: Cannot read properties of undefined (reading 'blocksByName') HOT 1
- Joining serverr: ERROR is not valid JSON HOT 2
- Microsoft Auth HOT 3
- nearestPlayer in python
- Error: Profile not found, please restart your launcher if you recently created your profile HOT 6
- Current axios version contains CSRF vulnerability. HOT 1
- No goal_reached Event at all
- Do not have protocol data for protocol version 766 (attempted to use 763 data) HOT 3
- Bot doesn't reconnect to the server HOT 1
- Protocol Error HOT 1
- add support for early versions of minecraft like alpha 1.2.6 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mineflayer.