moincraft

๐Ÿ‘๏ธ Viewer

Prismarine Viewer architecture, version compatibility, reconnect strategy, config, and exposure warnings.

Moincraft uses a global Prismarine viewer process (bots/viewer.js) plus per-agent viewer ports for visual world state.

Architecture#

viewer.js
  โ†’ mineflayerViewer(bot, { port })
  โ†’ Express + Socket.IO
  โ†’ Browser Three.js/WebGL world view

Default config#

Variable Purpose
PORT=55669 Global viewer HTTP port.
VIEWER_USERNAME=Spectator Dedicated viewer bot login.
VIEWER_VIEW_DISTANCE=8 Chunk radius. Lower on weak hosts.
VIEWER_RENDER_VERSION=1.21.4 Compatibility render target.
VIEWER_VERSION_FALLBACK=true Allow fallback behavior.
VIEWER_RECONNECT_BASE_MS, VIEWER_RECONNECT_MAX_MS, VIEWER_RECONNECT_JITTER_MS Reconnect backoff shape.

Version compatibility#

The server is newer than Prismarine’s best-supported render version. The custom compatibility layer maps chunk/block state IDs into a supported render version and can fallback when version mismatch kicks happen.

Safety#

The viewer has no built-in authentication. Do not expose it publicly without firewall/VPN or reverse-proxy authentication.

Common issues#

Symptom First check
Blank chunks Bot spawned and received chunks?
Port in use Only one viewer process? PM2/systemd/manual conflict?
Lag Lower VIEWER_VIEW_DISTANCE; use dedicated spectator bot.
Duplicate login Viewer username distinct from bot usernames?

Sources: moincraft/docs/PrismarineViewer.md, moincraft/docs/moincraft-stack-cheatsheet.md, moincraft/docs/security-hardening.md.