prismarinejs / mineflayer Goto Github PK
View Code? Open in Web Editor NEWCreate Minecraft bots with a powerful, stable, and high level JavaScript API.
Home Page: https://prismarinejs.github.io/mineflayer/
License: MIT License
Create Minecraft bots with a powerful, stable, and high level JavaScript API.
Home Page: https://prismarinejs.github.io/mineflayer/
License: MIT License
I'm just commenting to mention that your use of bitfields for sub-byte sizes is not portable or safe, since the actual ordering of the bits, and their storage/alignment/padding varies by system.
Simply put, your packets may suddenly cease to work on other systems/compilers, if those nibbles are individually padded to a full byte (which can happen).
I found this bug using my finder script. If I mine a block, the mf.blockAt function still reports the block as being there, until the chunk is unloaded, then reloaded.
items.js and eat.js need updating.
When I run mineflayer through Qt on Windows, it crashes at seemingly random times. The times it crashes are very inconsistent. Crashes bring up the "Mineflayer.exe has stopped working" windows dialog box.
It was fun sticking it to the man, but for mineflayer to work as a library, it makes much more sense to stick with the "standard" coordinate system.
Stand atop a hill looking over a cliff and say "tunnel". Make sure your bot has plenty of cobblestone or dirt.
The bot will build 10 layers or so and then segfault. (tested on localhost)
superjoe30 and I have talked about whether to keep maintaining or to drop the C Library interface. We both vote it should be dropped. This would enhance the interaction of the two components of the project and reduce a good deal of code that simply translates between C and C++ constructs.
The mineflayer-script inventory library doesn't handle the difference between a single and a double chest, and instead treats both as double chests.
currently we remove some characters that are legal
I do this command to run it and it doesn't run.
rymate@ryan-laptop ~/mineflayer/examples
mineflayer --url rymate1234@_______.dyndns.org --password _____ -I../lib/ random_wanderer.js
Got bus address: "unix:abstract=/tmp/dbus-boYALXTqE0,guid=b74a2b10ff268637ba97c8950000007b"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-boYALXTqE0,guid=b74a2b10ff268637ba97c8950000007b"
Registered DEC: true
Registered event listener change listener: true
Segmentation fault (core dumped)
How to fix this? :(
mf.hax.setGravityEnabled(false); // turn off gravity (but not collision physics)
mf.hax.setPosition(node); // zap quickly around to each point in the path
To some extent, you won't have to implement the mods directly, but at least send the packet that Forge wants to let it work? shrug
Hi,
1.8 seems to have fetched a few new features and a few hickups.
I'll split my posts out for ease.
I'd like to request the new features brought with 1.8's protocol including 0xC9 and 0xFE - both have stats about the state of the server and the other players currently online.
There is some issues with the inventory library being inefficient when a chest is full. It noticeably clicks every stack in the chest.
The move functions are also due for an overhaul, and should probably support shift-clicking in the overhaul.
When in creative, no damage is taken, digging is instant, and flying is allowed.
Items can be spawned, and blocks in the inventory are infinite. An API for this would be great.
This happens during shutdown sometimes and causes intermittent failures in the test suite.
Other such errors are these:
QMutex: mutex destroy failure: Device or resource busy
QWaitCondition::wakeAll(): mutex lock failure: Invalid argument
Hi,
1.8 seems to have fetched a few new features and a few hickups.
I'll split my posts out for ease.
Aside from issue #23 - the server handshake/login seems to be broken.
Eventually get the message that connecting took too long.
Hi. Mineflyaer javascript-engine provides a handlers for some gameplay events like "onChat()" or "onHealthChanged()" etc. Can you add a new event handler like a "onEntityAttacked", this event is called when one entity is attacking another (mob, player or self)? This event is helful to create an bots are strike if they are attacked, for example.
Regards, Cr0s.
P.S. Sorry for my bad english, I'am from Russian Federation.
If I tell a bot to navhere, he gets stuck whenever he has to jump on top of a block. He will continuously jump, repeatedly informing me that he "can get there in X moves".
It seems that he is not jumping high enough.
I noticed today on superjoe.zapto.org that because there is delay, the torch solution for digging gravel in a column can sometimes fail. I think the reason is that the bot does not switch tools in time to place the torch. Instead, the bot digs the bot, switches to the torch, the gravel falls, and the bot gets stuck until rebooted.
I suspect that the cause is the combined time of the wait (to avoid the top block staying in place), along with a slow tool-switching operation, though I am not sure how the code is implemented yet.. I have on my todo list to take a look at the builder library's code.
navigator could be optimized by taking the hypotenuse of rectangular paths.
Hi,
1.8 seems to have fetched a few new features and a few hickups.
Firstly the Auth page at http://www.minecraft.net/game/getversion.jsp has gone - it's 404ing. Using https://login.minecraft.net/ should work
the follower.js script spams the player when navigator arrives, and there are no additional tasks. This is also related to task manager's postpone function not resuming correctly.
The Physics simulation seem to treat Open Doors, Steps and half blocks as full blocks.
I'm not getting events for door opening and closing, at least not chunkUpdate events.
http://mineflayer.com/doc/html/mf.html has fallen behind the latest changes.
If I tell the bot to navhere, he isn't able to do it
instead of
EXTRA_CONFIG=headless qmake ../mineflayer/mineflayer.pro
make
it should be
qmake ../mineflayer/mineflayer.pro
EXTRA_CONFIG=headless make
or somesuch, or change mineflayer.pro put EXTRA_CONFIG in the root Makefile.
This is due to relying on packet 0x2a which is unreliable. We'll need to set timers or something.
For Charged Miners mineflayer_blockAt is to slow.
Bots want to know which half of the bed you can sleep in. This information is communicated through the metadata. Branch "drill" already has added a metadata field to mf.Block and mf.Item objects 895333f. We need some code somewhere that alleviates the need for scripts to hardcode metadata meanings. This could be as simple as enums in builtin_types.js.
Mineflayer currently sends 'false' for the "is_shift" value every time any window slot is clicked (see Game::doWindowClick), instead of presenting the javascript with an interface.
I'm not sure what sort of messages get passed between the server when someone shift-clicks (a regular click seems to get a TransactionResponse), but Game::handleTransaction doesn't seem to handle shift-clicks either.
Around 1 second after it connects, it spits out an error and terminates. Works fine on a local server though.
I got Qt Creator but I'm not sure how to debug scripts.
Every script that connects to this remote server gives the same error.
Launching with:
./mineflayer --debug --url RuansBot@[server]:25565 examples/connection_notice.js
connected
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
dmesg:
[179762.793904] mineflayer[22777]: segfault at 50 ip b66b8ec7 sp b217c2c0 error 4 in libQtCore.so.4.7.4[b665d000+289000]
Also getting this error when my bot gets stuck inside a block.
I'm thinking something like:
var native_library = mf.include_native("libhax.so");
or even:
mf.include("libhax.so");
It's a wild idea, I know. Just thought I'd start a discussion on it. To start, there's an obvious portability issue with the above examples.
It'd be nice to autogenerate the documentation based on the code.
When bot navigating to position above current, bot jumps on a block and server sometimes kicks a bot with reason "Flying is not enabled on this server".
Would be nice to test:
When I tell a bot to 'flatten' or 'tunnel' or 'drill', the bot is unable to dig any block.
Note: placing blocks works.
Game::handleMultiBlockUpdate():
Int3D absolute_location = iterator.key();
This line crashes with:
ASSERT: "item_exists()" in file ../../../qtsdk-2010.05/qt/include/QtCore/qhash.h, line 1032
The update is a wooden door swinging on its hinges. It has two blocks in the update, both wooden doors (64), stacked on top of eachother, with metadatas 5 and 13. This makes me think this is related to Issue #11.
Reproduce this problem by running a bot for a while (at least 10 seconds). and then opening/closing a wooden door. Then maybe it will happen. I wonder if it's a race condition.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.