Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Replit 14 min read How-to mediumAdept

Automating Minecraft on Replit

Replcraft is a JavaScript library that lets code running in a repl control a structure on a Minecraft server: placing and reading blocks, watching for changes, detecting entities, reading redstone and crafting items. The tutorial walks through small projects, starting with token setup via an iron-frame structure and sign. From there it builds a cobblestone generator harvester, a player trap, a redstone-triggered sensor, an automatic tool crafter, a minecart-based base mover and pixel-art drawing with wool. Along the way it notes API tradeoffs. `watch` is fast but only catches some kinds of changes. `poll` catches everything but checks one block per tick, so it slows as more blocks are polled and can miss quick change-and-revert events. `getEntities` is expensive. Moving blocks also follows normal Minecraft drop rules, which loses some of them, such as shattered glass.

Assumes: JavaScript async/awaitMinecraft basics

Related posts

  • Replit²

    Replit mediumAdept

    A Replit Nix repl can act as a code-execution backend: a Koa.js server spawns a Python child process and feeds user code through stdin, using code.InteractiveInterpreter, which avoids shell injection and keeps crashes from taking down the server. A second repl works as a proxy that load-balances across forked compute nodes, tracking per-node concurrent calls in Replit Database with a usage threshold and HTML-escaping input. A simple web component front end calls the cluster's API. A security section notes the limits of this sandboxing approach.

  • Introducing Kaboom

    Replit mediumAdept

    Kaboom is a JavaScript game library from Replit aimed at beginners and intermediate programmers. Game objects are built from composable components, which are plain functions returning objects with lifecycle hooks (add, update, draw) and methods merged into the object. String tags let you attach group behaviors and collision handlers, and helpers like addLevel turn ASCII-art maps into levels. A dedicated Replit environment adds sprite editing, asset management and debug tools such as bounding-box display, time scaling, pause and frame stepping.

  • AI Agent Code Execution API

    Replit mediumAdept

    Replit offers sandboxed code execution so LLM agents can run untrusted generated code, contrasting a stateless model (like Bard's implicit code execution for math) with a stateful, session-long project environment (like ChatGPT). The stateless option is a forkable API server on Replit Autoscale Deployments, using the omegajail unprivileged container sandbox with a customizable Docker image, handling requests in as little as 100ms and integrating with OpenAI function calling via the replit-code-exec package. A stateful prototype using a full Repl as sandbox was tried and then discontinued, with code-exec recommended for most use cases.

  • Getting Started with Solidity on Replit

    Replit mediumAdept

    Replit's Solidity template lets you compile and deploy smart contracts to a built-in Replit Testnet from the browser, using MetaMask as the wallet and faucet-provided test ETH. The walkthrough deploys a MathTest calculator contract, then extends it. Because deployed contracts are immutable, adding functions means redeploying a new contract rather than updating the old one. A SimpleStorage contract illustrates the difference between view functions, which only read state and need no gas, and state-modifying functions, which cost gas.

  • Introducing the Replit Desktop App

    Replit mediumAdept

    Replit now ships a native desktop app for macOS, Windows and Linux, centered on the IDE workspace, with multiple windows, editor shortcuts the browser would intercept (Cmd/Ctrl+T/W), deep linking and native Chromium devtools. It is built on Electron rather than React Native, which lacked Linux support, or Tauri, which was missing deep linking and native APIs for remotely loaded URLs and brought cross-platform rendering differences and Rust iteration costs. The app remotely loads part of the website, exposes Node APIs to the web client, and is packaged and signed per platform and architecture with Electron Forge in GitHub Actions. Auto-updates go through a Hazel-based release server deployed on Replit.

The quest for software engineering knowledge.

Look:
Layout: