Elytra Autonomous Flight Engine
Autonomous elytra flight for Minecraft — takeoff, climb, cruise, land. Zero config.
npm install @eksses/eafe mineflayerconstmineflayer=require('mineflayer');const{ ElytraFlight }=require('@eksses/eafe');constbot=mineflayer.createBot({host: 'localhost',username: 'Bot'});bot.once('spawn',()=>{constflight=newElytraFlight(bot);flight.fly(500,500);});| Feature | Description |
|---|---|
| 3 Flight Modes | FAST (30 m/s), MED (22 m/s), LOW (15 m/s) |
| Smart Landing | Auto land at safe spots with margin check |
| Elytra Audit | Checks durability before flight |
| Auto Rocket | Equips rockets automatically |
| Terrain Avoidance | Scans and avoids obstacles |
| Owner Alerts | Whisper notifications |
| Wander Scan | Searches for safe spots over any terrain |
| Retry System | Auto retry on failure |
Create a flight instance.
constflight=newElytraFlight(bot,{mode: 'MED',// 'FAST' | 'MED' | 'LOW'cruiseAlt: 180,// Cruise altitude (Y blocks)maxRetries: 3,// Retry attempts on failuresafety: true,// Pre-flight checks enableddebug: false,// Verbose logging (false for production)ownerUsername: '',// Whisper alerts to this playerlandingMargin: 2,// Blocks from edge of landing spottargetX: 0,// Default target XtargetZ: 0,// Default target Z});Fly to coordinates. Options override constructor options.
flight.fly(500,500);flight.fly(500,500,{mode: 'FAST',cruiseAlt: 200});Emergency stop. Lands bot immediately.
flight.stop();flight.stop('out of rockets');Change flight mode.
flight.setMode('FAST');// FAST, MED, LOWSet target without flying.
flight.setTarget(100,200);Get flight status.
conststatus=flight.setStatus(500,500);// {// phase: 'CRUISE',// mode: 'MED',// pos: { x: 100, y: 180, z: 200 },// target: { x: 500, z: 500 },// dist: 350,// elytra: { dur: 400, count: 2, unbreaking: 3 },// rockets: 20,// flying: true// }Pre-flight check without flying.
constcheck=awaitflight.preflight();// {// ok: true,// elytra: { have: 432, need: 50 },// rockets: { have: 20, need: 8 }// }Boolean — true if elytra is active.
Current phase: IDLE, AUDIT, TAKEOFF, CLIMB, CRUISE, LAND, WANDER, FAILED.
flight.on('phase',(phase,msg)=>{console.log(phase);// TAKEOFF, CLIMB, CRUISE, LAND, IDLE});flight.on('stopped',(reason)=>{console.log(reason);// user, respawn, out of rkt});flight.on('error',(err)=>{console.error(err.message);});| Mode | Speed | Fuel Use | Use Case |
|---|---|---|---|
FAST | 30 m/s | High | Emergency, short distance |
MED | 22 m/s | Medium | Default, balanced |
LOW | 15 m/s | Low | Long distance, fuel efficient |
AUDIT → TAKEOFF → CLIMB → CRUISE → LAND → IDLE
↘ WANDER (no spot found)
↘ FAILED (error)
- AUDIT — Check elytra durability and rockets
- TAKEOFF — Jump and activate elytra
- CLIMB — Ascend to cruise altitude
- CRUISE — Fly toward target
- LAND — Spiral descent to safe spot
- WANDER — Search for safe landing spot
- IDLE — Landed or stopped
- FAILED — Error occurred
const{ countRockets, getElytraSummary }=require('@eksses/eafe');constrockets=countRockets(bot);// Numberconstelytra=getElytraSummary(bot);// { totalDurabilityAcrossAll, count, bestUnbreaking }| Example | Description |
|---|---|
basic.js | Simple flight |
demo.js | Chat commands |
delivery.js | Multi-stop delivery |
waypoint-travel.js | Location loop |
rescue-bot.js | Player rescue |
multi-bot.js | Fleet control |
inventory-transfer.js | Chest transfer |
api-demo.js | API showcase |
- Node.js ≥ 16.0.0
- mineflayer ≥ 4.0.0
- Bot must have elytra equipped in chest slot
- Bot must have firework rockets in inventory
MIT