Repository navigation
Tutorial: build an arena minigame - #25
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
- mc.on / region:on overloads listed several event names in one union; LuaLS matched only the first, so e was untyped in player.join, player.leave, tick, entity.death, block.place and others. One overload per name now. - chestgui: describe the real API (set/button/decorate/open/close) instead of setItem/onClick, which the library does not have. - mc.createItem: add the (id, opts) form used by demo.lua. - Fix a syntax error in mc.registerBehaviour, drop vec operators LuaLS does not support, move SimpleLib.defaultOverlay under its class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7gxWF7FdViJa9dKAZJiac
register(syntax, fn, permission) and player:hasPermission used Permissions.check without a default level, which is false when no permissions mod answers. On a server without one, nobody (operators included) could run a script command that has a permission. Fall back to op level 4, like /ignis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7gxWF7FdViJa9dKAZJiac
Assigning a table to mc.data/player.data stores a copy. The whitelist example assigned an empty local table and kept changing the local one, so entries added before the next reload were never saved. Explain the rule in the storage reference and note how permissions behave without a permissions mod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7gxWF7FdViJa9dKAZJiac
A step-by-step tutorial that grows one script, config/ignis/arena.lua, into a PvP arena: setup commands and mc.data, a region with block protection, a game loop with phases, knockouts via entity.death, boss bar and sidebar, statistics and a leaderboard hologram, kits with a chestgui menu and stashed inventories, an arena:win event with a rewards script, and cleanup on reload. Each chapter ends with the complete file (site/tutorial/arena/NN-*.lua, embedded in the page). site/tutorial/test.sh checks that the snippets in the pages match those files, runs lua-language-server against lua-types on them, and plays the game through a fake API in Lua 5.2; a new CI job runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7gxWF7FdViJa9dKAZJiac
PyXiion
force-pushed
the
claude/arena-tutorial
branch
from
September 28, 2026 12:23
4c61aef to
f7381de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #24: the tutorial uses the new event model. Once #24 is merged, this PR's base becomes
master.Tutorial
A nine-chapter tutorial on the site (
/tutorial). It grows one script,config/ignis/arena.lua, into a PvP arena where the last player standing wins:register, permissions,mc.data, and the "assigning a table stores a copy" rule.priority.mc.scheduleRepeating, and a celebration withasync.sleep.entity.death, and regionenter/leavehandlers.player.data, a leaderboard inmc.data, a hologram.serialise, and kits are picked from achestguimenu.mc.emit("arena:win")plus a separate rewards script (diamonds, a Discord webhook viaasync.fetch).uninit, returning items after a crash, debugging.Each chapter ends with the complete file at that point (
site/tutorial/arena/NN-*.lua, embedded via?raw).Checks (
site/tutorial/test.sh, newtutorialCI job)lua-language-server --checkagainstlua-types/(Lua 5.2, including hints).lua5.2against a fake API (test/mock.lua):The tutorial has not been run on a real server. Only the mock and LuaLS verify it.
Bugs found along the way
mc.on/region:onoverloads listed several events as a union. LuaLS only matched the first one, soewas untyped inplayer.join,player.leave,tick,entity.death,block.placeand others. There is now one overload per event.chestguitypes described methods that don't exist.mc.createItem(id, opts)was missing.registerBehaviour.register(..., perm)andplayer:hasPermissioncalledPermissions.checkwithout a default level. That returnsfalsewhen no permissions mod answers, so on a server without one, nobody (not even operators) could run a script command that has a permission./ignis.mc.dataand then changed the local one, so entries were not saved until a reload. The storage reference now explains the copy semantics.🤖 Generated with Claude Code
https://claude.ai/code/session_01X7gxWF7FdViJa9dKAZJiac
Generated by Claude Code