Fix issue #12: Update README.md
Some checks failed
build / build (pull_request) Failing after 57s
build / build (push) Failing after 57s

This commit is contained in:
Gitea OpenCode Agent
2026-10-13 17:55:27 +00:00
parent fe084e1843
commit 3861cdfddf

View File

@@ -1,6 +1,26 @@
# codecraft
Players write Lua in the in-game editor (`J` by default) and run it on the server.
A Fabric mod for Minecraft that lets players write and run [Lua](https://www.lua.org/) code directly in-game — no datapacks, no external tooling, no server restarts.
## Purpose
codecraft turns the game itself into a scripting environment. Open a code editor from inside Minecraft, write Lua against a curated game API, and press **Run**: the script executes on the server and changes the world. It is meant for players who want to automate, build, and experiment with code, and for servers that want to hand their community a safe, documented entry point into programming with Minecraft.
## Features
- **In-game editor** — open with `J` by default (rebindable): multi-file projects with a folder tree, tabs, syntax highlighting, autocomplete, snippets, find/replace, and themes.
- **Server-side Lua runtime** — scripts run on the server thread through a pure-Java Lua interpreter ([luajava](https://iroiro.party/luajava/)); the project is stored on the server under `config/codecraft/` as plain `.lua` files, so it can also be edited with external editors.
- **Game API** — place and break blocks, query and spawn entities, manage items and inventories, scoreboards, HUD and boss bars, weather and time, and listen to [events](docs/lua-api.md#events) that keep running after a script finishes.
- **In-game documentation** — the full Lua API reference is browsable inside the editor (Help → Lua API Documentation, or `F1` on a function), with search.
- **Collaboration** — live shared documents let multiple players edit the same file at once.
- **Terminal** — an integrated terminal pane with a server-side shell.
## Getting started
1. Install the mod with [Fabric Loader](https://fabricmc.net/) and the [Fabric API](https://modrinth.com/mod/fabric-api).
2. Join a server (or open a world) and press `J` to open the editor.
3. Write your script in `main` and hit **Run Script**.
Scripts can place and remove blocks through the `world` table:
```lua
@@ -9,12 +29,31 @@ for y = 64, 67 do
end
```
The API is documented in [docs/lua-api.md](docs/lua-api.md).
## Documentation
## Setup
The user-facing Lua API is documented in [docs/lua-api.md](docs/lua-api.md), and the same reference is available in-game from the editor.
For setup instructions, please see the [Fabric Documentation page](https://docs.fabricmc.net/develop/getting-started/creating-a-project#setting-up) related to the IDE that you are using.
## Requirements
| Component | Version |
| -------------- | ---------- |
| Minecraft | 26.2 |
| Fabric Loader | ≥ 0.19.3 |
| Fabric API | 0.153.0+26.2 |
| Java | 25 |
## Building from source
Requires JDK 25.
```sh
./gradlew build # compile and build the mod jar (output in build/libs/)
./gradlew runClient # launch a dev client with the mod loaded
./gradlew runDatagen # regenerate data (lang files)
```
For general Fabric development setup instructions, see the [Fabric Documentation page](https://docs.fabricmc.net/develop/getting-started/creating-a-project#setting-up) related to the IDE that you are using.
## License
This template is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects.
This project is available under the CC0-1.0 license. Feel free to learn from it and incorporate it in your own projects.