{"name":"minecrafthawkeye","version":"1.0.0","description":"Minecraft bot for equations when shooting an arrow","main":"index.js","dependencies":{"mineflayer":"^2.28.1","mineflayer-pathfinder":"^1.0.10"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"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"],"gitHead":"7f18dc12ead493a94262af12fd4814648fb218e8","_id":"minecrafthawkeye@1.0.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-1yhk8JV4Iut3PxEL29oKocYEQbEtsdFE0rZAjSCxlE/XwiPIij5ggKHxwvfJqi8cnS3vP8Td++1dNffcIrL9yw==","shasum":"6e2fea1b03cefd6f7e23e3b8450207f29055e571","tarball":"http://registry-npm.ywwl.com/minecrafthawkeye/download/minecrafthawkeye-1.0.0.tgz","fileCount":17,"unpackedSize":2858000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffhK3CRA9TVsSAnZWagAAgrIP/2s8KHEXlBEbCmGysdMu\n+qFFToZqYfxla6gQgoVg2zD5pOeOOvj0LBTDJUvIzuGRzdiXTxkV/EumD9KX\nSgxvN6VLZfLKFOW7GwBCh8URsj+Cfh/uWh0c0usmmidKQYFeZg4CtPx8anQL\nMvQE/GXqHbdustYi3JEAje1wTwR2lqed8DvNHgVbZO1hyz2/NBYcn9DVZJso\nSjFfWxKuEk1481J3y25fLM29ydbLxqAvbxx9yfuOO0E5DZU4Gd0n5NnwRjj7\nSI6iTrHVUKP5pGReokKGNyh4ovHO/umCQPXNJ6lWK/GMNxn8oxdyBsFug9S1\nsCGAXTTty/6BwvHG5tYhH6GwQA1lXlmhzdvsXXIuNAxGLNAm0EuZ8d0nupI0\nz56v6vuq7YvevA7Xg1ElHjLGVulhd7iWDx8MohWugqXeMZsk2r5lP0Ckl2bw\nO39YoB+raP5Qt5B3jlPIAr1KhpudSSRbXg5UhGXcS+lJ7DC4rx1skL0K2pbj\nlpsG4XPxQJUhsvazfIzHB886+uv9+6Ltu+JyFqHXT8hRzi0CSJvEo3jWMnWV\n08XxZduHDe34NHufhPzQkbV8zgTrQkEPT/gmVfPRzYMxsJJy8bXxhEoqKZQJ\ngZg9QtJD7Uz0PQgYyWbwTYAuUm5k2yLmqZdf0GxuIiS6UQ+W29I+EBX5GBPQ\nYmNm\r\n=gWlV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDopXAv2wxGtgSuuF360dv74x3iFDveIx4ypoR5qs/KzgIhAKk9RC1V5W3JVya0OBG4dxkTIMOsHMW5dtrEh8qEkfFp"}],"size":2785784,"noattachment":false,"key":"/minecrafthawkeye/-/minecrafthawkeye-1.0.0.tgz"},"maintainers":[{"name":"sefirosweb","email":"javier.garcia.fillol@gmail.com"}],"_npmUser":{"name":"sefirosweb","email":"javier.garcia.fillol@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minecrafthawkeye_1.0.0_1602097847021_0.8427759535247621"},"_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":1602097847371,"_cnpm_publish_time":1602097847371,"dist-tags":{"latest":"1.3.9"}}