适用于 Fabric 服务器的 Lua 运行时,支持热重载。在 config/ignis/ 中编辑脚本,运行 /ignis reload,更改即可即时生效。
完整文档请访问 ignis.pyxiion.ru。
关于
PxIgnis 是与一个完全原版的自定义 Roguelike 服务器同步开发的。其 API 反映了该项目本身的需求。
主要功能
- Lua 热重载运行时 —
/ignis reload可在毫秒级内重新运行脚本。命令会被重新注册到实时的 Brigadier 分发器中,无需重启服务器。 - 命令注册 —
register("cmd <name:type> [<name:type>]", handler, permission?)。内置参数类型:int、double、float、bool、text、word、player、block_pos、choice=...。Tab 补全和权限(如admin.cmd)均包含在 API 中。 - 事件与取消机制 — 15+ 个钩子:
player_block_break、player_chat、player_attack_entity、entity_hurt、entity_death等。返回false即可取消事件。 - 区域与脚本化生物 AI — 具有进入/离开/移动/死亡事件的 spatial areas(空间区域),以及用于自定义生物 AI 的 API。
- 协程、持久化存储、UI —
mc.fetch/mc.sleep用于顺序异步代码,player.data/mc.data/ 存储后端用于持久化状态,此外还包括全息图、侧边栏以及用于自定义容器的chestgui库。
还有更多……
示例
1. 区域 + 异步
local arena = world:createRegion(vec(-50, 64, -50), vec(50, 80, 50))
arena:on("entity_enter", function(entity)
if entity:isPlayer() then
mc.broadcast(entity.name .. " entered the arena")
coroutine.wrap(function()
local res = mc.fetch("https://api.example.com/arena/log")
if not res.ok then
mc.broadcast("log failed: " .. res.error, true)
end
end)()
end
end)
2. 生物 AI
--# nova 语法
-- 启用尾随 lambda 的酷炫自定义语法(类似于 Kotlin)
mc.registerBehaviour("zombie_chase") \{ self, mob ->
local p = mc.players[1]
if p then
local pos = p.pos
mob:navigateTo(pos.x, pos.y, pos.z, 1.0)
end
}
mc.on("entity_spawn", function(entity)
if entity:isMob() and entity.type == "minecraft:zombie" then
entity:setAI("zombie_chase")
end
end)
3. 带权限的命令
register("pay <amount:int> <target:player>", function(ctx, amount, target)
ctx.player.data.balance = (ctx.player.data.balance or 0) - amount
target.data.balance = (target.data.balance or 0) + amount
target:sendMessage("Received " .. amount .. " from " .. ctx.player.name)
end, "pxrp.economy")
安装与要求
- 安装 Fabric Loader ≥0.19.2、Fabric API ≥0.141.4+1.21.11 以及 Fabric Language Kotlin ≥1.10.8。
- 将
pxignis-*.jar放入服务器的mods/文件夹中。 - 启动服务器。首次启动时会创建
config/ignis/demo.lua。 - 编辑
config/ignis/下的脚本,然后运行/ignis reload。
许可证
GNU Lesser General Public License v3.0
A Lua runtime for Fabric servers, with hot-reload. Edit scripts in config/ignis/,
run /ignis reload, and changes apply instantly.
Full documentation at ignis.pyxiion.ru.
About
PxIgnis is developed in tandem with a fully Vanilla custom Roguelike server. The API reflects what the project itself needed.
Key Features
- Hot-reload Lua runtime —
/ignis reloadre-runs scripts in milliseconds. Commands are re-registered into the live Brigadier dispatcher without restarting the server. - Command registration —
register("cmd <name:type> [<name:type>]", handler, permission?). Built-in argument types:int,double,float,bool,text,word,player,block_pos,choice=.... Tab completion and permissions (admin.cmd) are part of the API. - Events, with cancellation — 15+ hooks:
player_block_break,player_chat,player_attack_entity,entity_hurt,entity_death, and more. Returningfalsecancels. - Regions and scripted mob AI — spatial areas with enter/exit/move/death events, and API for custom mob AI.
- Coroutines, persistence, UI —
mc.fetch/mc.sleepfor sequential async code,player.data/mc.data/ storage backends for persistent state, plus holograms, sidebars, and thechestguilibrary for custom containers.
And more, and more.
Examples
1. Region + async
local arena = world:createRegion(vec(-50, 64, -50), vec(50, 80, 50))
arena:on("entity_enter", function(entity)
if entity:isPlayer() then
mc.broadcast(entity.name .. " entered the arena")
coroutine.wrap(function()
local res = mc.fetch("https://api.example.com/arena/log")
if not res.ok then
mc.broadcast("log failed: " .. res.error, true)
end
end)()
end
end)
2. Mob AI
--# nova syntax
-- enabling cool custom syntax for trailing lambdas (just like Kotlin)
mc.registerBehaviour("zombie_chase") \{ self, mob ->
local p = mc.players[1]
if p then
local pos = p.pos
mob:navigateTo(pos.x, pos.y, pos.z, 1.0)
end
}
mc.on("entity_spawn", function(entity)
if entity:isMob() and entity.type == "minecraft:zombie" then
entity:setAI("zombie_chase")
end
end)
3. Command with permission
register("pay <amount:int> <target:player>", function(ctx, amount, target)
ctx.player.data.balance = (ctx.player.data.balance or 0) - amount
target.data.balance = (target.data.balance or 0) + amount
target:sendMessage("Received " .. amount .. " from " .. ctx.player.name)
end, "pxrp.economy")
Installation & Requirements
- Install Fabric Loader ≥0.19.2, Fabric API ≥0.141.4+1.21.11, and Fabric Language Kotlin ≥1.10.8.
- Place
pxignis-*.jarinto themods/folder of your server. - Start the server.
config/ignis/demo.luais created on first boot. - Edit scripts under
config/ignis/, then run/ignis reload.
License
GNU Lesser General Public License v3.0
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
下载 PxIgnis
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧