Console variables and debugging functions available in the browser console
The Minecraft Web Client exposes several global variables to the browser console for debugging and advanced interactions. Access these by opening the console (F12) or typing #dev in the address bar on mobile.
On mobile, type #dev in the browser address bar to show a button that opens the console.
The Mineflayer bot instance. This is the main interface to the game client.Available: After connecting to a server or starting singleplayerUsage:
bot.entity.position // Current player positionbot.game.gameMode // Current game modebot.health // Player healthbot.food // Player food levelbot.inventory // Player inventorybot.chat('Hello!') // Send chat message
The Three.js world renderer instance. Handles all 3D rendering.Available: After the world renderer is initializedUseful properties:
world.sectionObjects // All active chunk sections (meshes)world.getCameraPosition() // Current camera positionworld.getLoadedChunksRelative() // Chunks relative to player
The Flying Squid server instance. Only available in singleplayer or when hosting.Available: Only in singleplayer modeUseful properties:
localServer.overworld.storageProvider.regions // All loaded region fileslocalServer.levelData.LevelName // World name// Change world name and savelocalServer.levelData.LevelName = 'New Name'localServer.writeLevelDat()
miscUiState.gameLoaded // Whether game HUD is shownmiscUiState.singleplayer // Whether in singleplayer modemiscUiState.flyingSquid // Whether Flying Squid is runningmiscUiState.wanOpened // Whether world is open to WANmiscUiState.showDebugHud // Whether F3 debug overlay is shownmiscUiState.showUI // Whether UI is visible (F1)miscUiState.fullscreen // Whether in fullscreen modemiscUiState.loadedDataVersion // Current MC version loaded