// Mineflayer bot instancebot// Three.js world renderer instanceworld// Local server instance (singleplayer only)localServerserver // alias for localServer// NBT utilitiesnbt.simplify(someNbt) // Simplifies NBT data for easier reading
// Toggle all debug messagesdebugToggle // Get current state and toggledebugToggle = 'minecraft-protocol' // Enable specific namespace// View top packet statisticsJSON.stringify(debugTopPackets)// Packet name referencesdebugServerPacketNames // All server->client packet namesdebugClientPacketNames // All client->server packet names
// Get all loaded chunk sectionsworld.sectionObjects// Relative to current position (0,0 is current chunk)debugSceneChunks// Helper functions for chunk/section keyschunkKey(xRel, zRel) // e.g., chunkKey(0, 1)sectionKey(xRel, yRel, zRel) // e.g., sectionKey(1, 0, -1)// Get camera positionworld.getCameraPosition()
// Get block at cursorcursorBlockRel(x, y, z) // With offset from cursorcursorBlockRel() // Block at cursor// Get entity at cursorentityCursor()// Holding blockholdingBlock
// View all loaded regionslocalServer.overworld.storageProvider.regions// Change world namelocalServer.levelData.LevelName = 'MyWorld'localServer.writeLevelDat()
// Camera position (updates continuously)world.getCameraPosition()// Current chunk position`${Math.floor(bot.entity.position.x / 16)}, ${Math.floor(bot.entity.position.z / 16)}`// Player velocitybot.entity.velocity// Current health and food`HP: ${bot.health} Food: ${bot.food}`// Loaded chunks countObject.keys(world.sectionObjects).length// Memory usage(performance.memory.usedJSHeapSize / 1024 / 1024).toFixed(2) + ' MB'
VSCode has excellent debugger support. Set breakpoints in your code and step through execution.For faster debugging, use the --no-sources flag to speed up source map parsing.
Clear Cache on Issues
Some data is cached between restarts. If something doesn’t work after updating dependencies:
rm -rf dist/
Check Console for Errors
Always check the browser console for errors and warnings. Enable verbose logging:
localStorage.debug = '*'
Test in Production Build
Some issues only appear in production builds. Test with:
// Watch player position and velocitybot.entity.positionbot.entity.velocity// Check if on groundbot.entity.onGround// View current control statebot.controlState