Skip to content

Repository files navigation

⚡ @eksses/eafe

Elytra Autonomous Flight Engine

npmLicenseDownloadsNode

Autonomous elytra flight for Minecraft — takeoff, climb, cruise, land. Zero config.


Install

npm install @eksses/eafe mineflayer

Quick Start

constmineflayer=require('mineflayer');const{ ElytraFlight }=require('@eksses/eafe');constbot=mineflayer.createBot({host: 'localhost',username: 'Bot'});bot.once('spawn',()=>{constflight=newElytraFlight(bot);flight.fly(500,500);});

Features

FeatureDescription
3 Flight ModesFAST (30 m/s), MED (22 m/s), LOW (15 m/s)
Smart LandingAuto land at safe spots with margin check
Elytra AuditChecks durability before flight
Auto RocketEquips rockets automatically
Terrain AvoidanceScans and avoids obstacles
Owner AlertsWhisper notifications
Wander ScanSearches for safe spots over any terrain
Retry SystemAuto retry on failure

API

new ElytraFlight(bot, options?)

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});

flight.fly(x, z, opts?)

Fly to coordinates. Options override constructor options.

flight.fly(500,500);flight.fly(500,500,{mode: 'FAST',cruiseAlt: 200});

flight.stop(reason?)

Emergency stop. Lands bot immediately.

flight.stop();flight.stop('out of rockets');

flight.setMode(mode)

Change flight mode.

flight.setMode('FAST');// FAST, MED, LOW

flight.setTarget(x, z)

Set target without flying.

flight.setTarget(100,200);

flight.setStatus(x, z)

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// }

flight.preflight()

Pre-flight check without flying.

constcheck=awaitflight.preflight();// {// ok: true,// elytra: { have: 432, need: 50 },// rockets: { have: 20, need: 8 }// }

flight.isFlying

Boolean — true if elytra is active.

flight.phase

Current phase: IDLE, AUDIT, TAKEOFF, CLIMB, CRUISE, LAND, WANDER, FAILED.


Events

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);});

Flight Modes

ModeSpeedFuel UseUse Case
FAST30 m/sHighEmergency, short distance
MED22 m/sMediumDefault, balanced
LOW15 m/sLowLong distance, fuel efficient

Flight Phases

AUDIT → TAKEOFF → CLIMB → CRUISE → LAND → IDLE
↘ WANDER (no spot found)
↘ FAILED (error)
  1. AUDIT — Check elytra durability and rockets
  2. TAKEOFF — Jump and activate elytra
  3. CLIMB — Ascend to cruise altitude
  4. CRUISE — Fly toward target
  5. LAND — Spiral descent to safe spot
  6. WANDER — Search for safe landing spot
  7. IDLE — Landed or stopped
  8. FAILED — Error occurred

Helpers

const{ countRockets, getElytraSummary }=require('@eksses/eafe');constrockets=countRockets(bot);// Numberconstelytra=getElytraSummary(bot);// { totalDurabilityAcrossAll, count, bestUnbreaking }

Examples

ExampleDescription
basic.jsSimple flight
demo.jsChat commands
delivery.jsMulti-stop delivery
waypoint-travel.jsLocation loop
rescue-bot.jsPlayer rescue
multi-bot.jsFleet control
inventory-transfer.jsChest transfer
api-demo.jsAPI showcase

Requirements

  • Node.js ≥ 16.0.0
  • mineflayer ≥ 4.0.0
  • Bot must have elytra equipped in chest slot
  • Bot must have firework rockets in inventory

License

MIT

About

Minecraft elytra autopilot engine — protocol-level autonomous flight navigation using Mineflayer. Vanilla physics-compliant per-tick velocity updates, anti-cheat Bézier curves, FSM state machine, Nether hazard avoidance, and precision landing. Includes multi-AI-agent audit with cross-model scoring.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages