PawnCraft
Write, compile, and run PAWN programs inside CC:Tweaked to control redstone, turtles, and peripherals.
介绍
PAWN meets ComputerCraft
Write a program. Compile it in-game. Make something move.
PawnCraft adds the PAWN scripting language to CC:Tweaked computers and turtles.
Control your farm, build a redstone controller, or put together a monitor dashboard
using a compact, C-like language. Your normal CraftOS terminal and existing Lua
programs stay available.
Meet the Annihilator

A bamboo harvester controlled by a PAWN redstone state machine. Probably more
dramatic than a bamboo farm needs to be.
See how it works and read the script.
The machine shown uses other mods; PawnCraft supplies its programmable controller.
What you can do
- Read redstone inputs and control digital, analog, and bundled outputs.
- Program turtles and call methods on connected peripherals.
- Write to monitors, work with files and JSON, and exchange modem messages.
- React to events and timers, with string helpers, formatted output, and float math.
The PAWN compiler and AMX runtime are bundled. No separate PAWN installation or
building from source is needed to use the published JAR.
Before you install
The machine running the world must use Linux x86_64 with glibc 2.38 or newer.
Windows, macOS, and ARM native binaries are not currently included.
- Minecraft 1.21.1 with NeoForge and Java 21.
- CC:Tweaked 1.120.2 or newer. Tested with 1.120.2 and NeoForge 21.1.248.
- On a dedicated server, install PawnCraft on the server. Connecting players
do not need the PawnCraft JAR, and their computers do not need to run Linux. - For singleplayer, these host requirements apply to your own computer.
Dependency note: CC:Tweaked no longer publishes new versions on CurseForge.
Its older CurseForge files do not satisfy PawnCraft’s minimum version.
See the CC:Tweaked project notice
and install a compatible NeoForge build separately.
Stop and back up your instance, then place the PawnCraft JAR from this project’s
Files tab in mods/ alongside the compatible CC:Tweaked JAR. Start the instance
and run help pawn in a ComputerCraft terminal.
Your first program
In the computer’s terminal, run:
edit hello.pwn
Enter this program:
#include <computercraft>
main()
{
if (printf("Hello from PawnCraft!\n") < 0)
return 1;
return 0;
}
Press Ctrl, choose Save, then Exit. Compile and run:
pawncc hello.pwn -o hello.amx
pawn hello.amx
Recompile after editing. Hold Ctrl+T to stop a running program.
Try the example programs
when you’re ready for redstone, countdowns, and event loops.
A few things to know
- PawnCraft uses the native CompuPhase PAWN compiler and AMX VM, connected to CC
through a Lua bridge. It is not a PAWN-to-Lua transpiler. - This is PAWN 4.1, not the SA-MP/open.mp API.
- Native execution is not an operating-system sandbox. Enable in-game
compilation only for players you trust. - PawnCraft does not keep chunks loaded. Computer shutdown or chunk unloading
stops its programs.
Documentation and support
User guide and API reference
| Source code
| Report a bug
For bug reports, include your mod versions, host OS, relevant logs, and a small
program that reproduces the problem.
PawnCraft’s original code is MIT licensed. Bundled third-party components retain
their respective licenses and notices.
常见问题
PawnCraft 支持哪些 Minecraft 版本?
PawnCraft 支持 Minecraft Java 版 1.21,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。
PawnCraft 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
评论
登录后评论和评分