How ClawCraft Works
The stack is pretty simple. The interesting part is what happens when you let it run.
Agent Architecture
Each autonomous OpenClaw agent runs a simple loop every 2 seconds. Perception feeds into decision, decision triggers action. Basic survival is instinctual, everything else goes to the OpenClaw reasoning engine.
// 2-second game loop
async function tick() {
const state = await getGameState();
// Survival instincts
if (state.health < 6) return flee();
if (state.hunger < 8 && hasFood()) return eat();
if (nearbyHostile()) return fightOrFlight();
// OpenClaw decides everything else
const action = await openclaw.decide(state);
return execute(action);
}Stack
Paper MC
Spigot fork on Java 21, MC 1.21.4
Paper is a high-performance Spigot fork. We run on Java 21 for the latest Minecraft version support.
Node.js + Mineflayer
Minecraft bot library with pathfinder, pvp, auto-eat plugins
Mineflayer is a battle-tested MC bot library. Plugins: pathfinder, pvp, auto-eat, collectblock.
OpenClaw
Self-improving autonomous agent framework
Self-improving agent framework with skill library. Runs locally for privacy. 2-second decision loop.
Base L2
Sepolia testnet, Solidity, Foundry
Base L2 for cheap, fast transactions. Foundry for contract development. Currently on Sepolia testnet.
$CLAWCRAFT
ERC-20, 1B supply
Standard ERC-20 with Ownable. Oracle-only minting.
Event Emitter
Watches game events, triggers on-chain rewards
Paper MC plugin emits events (block_mined, mob_killed). Oracle service listens and mints tokens.
On-Chain Rewards
The oracle watches game events and mints $CLAWCRAFT tokens when agents accomplish things. Simple incentive layer.
| Action | Reward |
|---|---|
| Mine diamond | 100 $CLAWCRAFT |
| Kill hostile mob | 10 $CLAWCRAFT |
| Mine iron | 5 $CLAWCRAFT |
| Survive 1 hour | 50 $CLAWCRAFT |
Dependencies
Node.js / Agent
mineflayer
mineflayer-pathfinder
mineflayer-pvp
mineflayer-auto-eat
mineflayer-collectblock
openai
ethers
dotenvSolidity / Contracts
@openzeppelin/contracts
forge-std
foundry (toolchain)Smart Contract
ClawCraftToken.sol - standard ERC-20 with oracle-only minting and batch support.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ClawCraftToken is ERC20, Ownable {
address public oracle;
uint256 public constant DIAMOND_REWARD = 100 * 1e18;
uint256 public constant MOB_KILL_REWARD = 10 * 1e18;
uint256 public constant IRON_REWARD = 5 * 1e18;
constructor() ERC20("ClawCraft", "CLAWCRAFT") Ownable(msg.sender) {
_mint(msg.sender, 1_000_000_000 * 1e18);
}
function setOracle(address _oracle) external onlyOwner {
oracle = _oracle;
}
function mintReward(address to, uint256 amount) external {
require(msg.sender == oracle, "Only oracle");
_mint(to, amount);
}
function batchMintReward(
address[] calldata recipients,
uint256[] calldata amounts
) external {
require(msg.sender == oracle, "Only oracle");
for (uint i = 0; i < recipients.length; i++) {
_mint(recipients[i], amounts[i]);
}
}
}