{"name":"minecrafthawkeye","version":"1.2.10","description":"Minecraft bot for equations when shooting an arrow","main":"dist/index.js","dependencies":{"mineflayer":"^3.6.0","prismarine-world":"^3.6.0","vec3":"^0.1.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/mocha":"^10.0.1","chai":"^4.3.7","minecraft-wrap":"^1.5.1","mocha":"^10.2.0","prismarine-viewer":"^1.19.2","standard":"^16.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"scripts":{"docker":"docker build -t docker_minecraft_hawk_eye . && docker run --rm -it --name docker_minecraft_hawk_eye_client  -v ~/.gitconfig:/etc/gitconfig -v $PWD:/home/app -w /home/app -u node -p 9992:9992 docker_minecraft_hawk_eye /bin/bash","start_server_test":"docker build -t docker_minecraft_hawk_eye . && docker run --rm -it --name docker_minecraft_hawk_eye_test_server -v $PWD:/home/app -w /home/app -u node -p 25565:25565 docker_minecraft_hawk_eye ts-node test/common/start_test_server.ts","test":"mocha -r ts-node/register -r test/hooks.ts --inspect=0.0.0.0:9992 --exit","test_all":"npm run test 'test/hawkTests/*.ts'","build":"rm dist -rf && tsc","standard":"standard --fix"},"repository":{"type":"git","url":"git+https://github.com/sefirosweb/minecraftHawkEye.git"},"author":{"name":"Sefirosweb"},"license":"ISC","bugs":{"url":"https://github.com/sefirosweb/minecraftHawkEye/issues"},"homepage":"https://github.com/sefirosweb/minecraftHawkEye#readme","directories":{"test":"tests"},"keywords":["minecraft","archer"],"types":"./dist/index.d.ts","gitHead":"c56cdc698eb92a388e9540a08920754463609216","_id":"minecrafthawkeye@1.2.10","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-1mTC6ekIcu3GJQDeVmDAi00N3RcCedj4RQ84UrxvTGKxcUdUCl3UcE09l0mLWGc1XPpN8Vrev13wReNJUaZcSw==","shasum":"85e0c029ecd5111643f8efa9fbcc6a6ce3b29239","tarball":"http://registry-npm.ywwl.com/minecrafthawkeye/download/minecrafthawkeye-1.2.10.tgz","fileCount":20,"unpackedSize":46820,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDzzrJr5xzIOWCcN3+YUoTzhd75MT5MkDuggPElvXWRSAiA2D8E6vc7yR/ODEbNg/TSXt79uuZ6xIc11/H+FhZBNIw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4h3oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzHg/+LkfnUHMe1nTHaDHa4jD8J4IHcpqVHdci05+GkAsDhxOcXWdX\r\nXicW0QprZ1pn2bYUmo1anUCAKte6Zsg/FbjioGZ9zb2nhXM3hvueXnr1BoGF\r\nd0yY1h/9FXMvYhPsjAogWihmMeSR5JAlc/6sazy2N8ClTC9ic0jNL6mB3aDO\r\n/CbQbK9fW3eAmJ/xKu12Xwf9alRqdQDIFtxK6H2uX/eI8Bz6xFFe/Bj0AaSX\r\nsOREpmrO9Hbelv6uURSkVi+Bfnq3KARGGRzDOQRmoUGq08IjOUOcGGtB0txI\r\nVjGz/3mHfHllc9jq5HYoEGD2WdD/y+b6+s0AnDcNq5eiQLJrkdJme4maHZjH\r\noaqPVKf7dpK/E/24fuf+KFaAwXheckWT1tm3REc0ZRLSKBuufHxoQEc7qpoT\r\nSEPLI2Oa05cMESfASQ7oVaz4Ix1fwNh49/DWFr8wao5xOTn2lJwohOEdBgDM\r\nqvZSjnO8OMzEYJzXGB/+OQ5lSJI4ggv/CxvBngMwkCAjFLlENeU0Ie8axFiH\r\nKj8C7FFZlbj6P2ZI9ytUiuxXOlL44Ko4dljl2dViyXH3LeqUOUsUAopFKW3R\r\n1KLaoD7A3SD/8cCiheYEVa9GcyCOaIIsD85yitJeB4dhmBWrRD36LzHqKV36\r\nhe1gk4zHCdVzeuFWajg4rzNabxkx+h9fWu4=\r\n=7rR6\r\n-----END PGP SIGNATURE-----\r\n","size":12118,"noattachment":false,"key":"/minecrafthawkeye/-/minecrafthawkeye-1.2.10.tgz"},"_npmUser":{"name":"sefirosweb","email":"javier.garcia.fillol@gmail.com"},"maintainers":[{"name":"sefirosweb","email":"javier.garcia.fillol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minecrafthawkeye_1.2.10_1675763176790_0.9088014942858542"},"_hasShrinkwrap":false,"readme":"# minecraftHawkEye\nModule for the Minecraft bot, hit 100% of the time with the bow, using the equations of parabolic shooting with friction\n\nThis module is based on bot of <a href=\"https://github.com/PrismarineJS/mineflayer\" target=\"_blank\">mineflayer</a> repository\n\nThis calculate the trajectory of arrow / snowballs... to ensure which is the best angle to hit,\n\nThey can hit from 120 blocks away!\n\nInstall:\n- Install nodejs >= 14 from nodejs.org\n- npm i minecrafthawkeye\n\nUsage: \n\nFirst load mineflayer and minecrafthawkeye, and load plugin into mineflayer\n```js\nconst mineflayer = require('mineflayer')\nconst minecraftHawkEye = require('minecrafthawkeye');\nbot.loadPlugin(minecraftHawkEye)\nconst weapon = 'bow'\n```\n\nNow you can request functions\n```js\n// Get an a entity\n// Example get te player entity, If emtpy return first player found\nconst playerEntity = bot.hawkEye.getPlayer(playername) \n\n// Auto attack every 1,2 secs to target\nbot.hawkEye.autoAttack(target, weapon)\n\n// Stop auto attack\nbot.hawkEye.stop()\n\n// Fire only 1 shot\nbot.hawkEye.oneshot(target, weapon)\n\n// Otherwise you can get Yaw and Pitch\nbot.hawkEye.getMasterGrade(target, speedInVec3, weapon)\n// With Yaw and Pitch you can use yourself bot.look(yaw,pitch) adn activate / deactivate main hand to fire\n\n\n// Similar has oneshot but need yo add manually the Pitch and Way in radians\nbot.hawkEye.simplyShot(yaw, pitch)\n\n// If you want the result of calculation of arrow trajectory you can use that\nbot.hawkEye.calculateArrowTrayectory(currentPosition, currentSpeed, pitch, yaw, 'bow')\n\n// Start to check if any player / mob or any incoming to bot\n// CAUTION: This use a lot of CPU, because on each tick game calculate all nearby mobs or players\nbot.hawkEye.startRadar()\nbot.hawkEye.stopRadar()\n\n// Return a array of mobs & players are looking in your direction\nbot.hawkEye.detectAim()\n\n// Return list of arrows are in \"air\" just now\nbot.hawkEye.detectProjectiles()\n\n\n```\n\nA example in one file:\n\n```js\n// ** Grant OP to Archer **\n// file: example.js\nconst mineflayer = require('mineflayer')\nconst minecraftHawkEye = require('minecrafthawkeye');\nconst Vec3 = require('Vec3')\n\nconst bot = mineflayer.createBot({\n    host: process.argv[2] ? process.argv[2] : 'localhost',\n    port: process.argv[3] ? parseInt(process.argv[3]) : 25565,\n    username: process.argv[4] ? process.argv[4] : 'Archer',\n    password: process.argv[5]\n})\n\nbot.loadPlugin(minecraftHawkEye)\n\nbot.on('spawn', function() {\n    bot.chat('/give ' + bot.username + ' bow{Enchantments:[{id:unbreaking,lvl:3}]} 1')\n    bot.chat('/give ' + bot.username + ' minecraft:arrow 300')\n    bot.chat('/time set day')\n    bot.chat('/kill @e[type=minecraft:arrow]')\n    bot.chat('Ready!')\n\n    // Get target for block position, use whatever you need\n    const target = bot.hawkEye.getPlayer()\n    console.log(target)\n    if (!target) {\n        return false\n    }\n\n    weapon = 'bow'\n    // Auto attack every 1,2 secs until target is dead or is to far away\n    bot.hawkEye.autoAttack(target, weapon)\n        // If you force stop attack use:\n        // hawkEye.stop();\n\n    // Use one shot time with calc:\n    // bot.hawkEye.oneShot(target);\n\n    // If you want to shot in XYZ position:\n    /*\n          const blockPosition = {\n                  position: new Vec3(244.5, 75.5, -220),\n                  isValid: true\n              }\n          // bot.hawkEye.oneShot(blockPosition);\n          // bot.hawkEye.autoAttack(blockPosition);\n      */\n})\n```\nAll is done, when is attack mode they get best possibility for impact, and shot arrow every 1,2 secs (max power)\n\n## Valid list of weapons or items that can calculate the perfect shot or launch it directly\n```\nbow\ncrossbow\nsnowball\nender_pearl\negg\nsplash_potion\ntrident\n```\n\nEvents:\n\nWhen but uses autoAttack and the mob is gone (killed o dissapeared)\n```ts\nbot.on('auto_shot_stopped', (target: Entity | OptionsMasterGrade) => {\n    ///\n})\n```\nWhen radar is active and some player or mob are aim you dispatch this event\n```ts\nbot.on('target_aiming_at_you', (entity: Entity, arrowTrajectory: Array<Vec3>) => {\n    ///\n})\n```\nWhen radar is active and When arrow are incoming and can be hit bot this event is dispatched\n```ts\nbot.on('incoming_projectil', (projectil: Projectil, arrowTrajectory: Array<Vec3>) => {\n    ///\n})\n```\n\nI'm glad I can help you, do we help each other?\n\n# Videos:\nhttps://www.youtube.com/watch?v=InMkncDnYTA\n\nhttps://www.youtube.com/watch?v=jjl4mMyL7hk\n\nhttps://www.youtube.com/watch?v=OHX3u8Nrrp8\n\nhttps://www.youtube.com/watch?v=VKg5xiww5Lo\n\n# TODOs\nNo TODOs!\nAnyone have more ideas? :D\n","publish_time":1675763176960,"_cnpm_publish_time":1675763176960,"dist-tags":{"latest":"1.3.9"}}