
BirdLibraryApi 将你的服务器变成一个实时脚本平台——使用你熟悉的 JavaScript、Lua 或 Python。只需将 .js、.lua 或 .py 文件放入 plugins/BirdApi/ 目录,即可得到一个功能完整的插件——支持事件、命令、计时器以及对 Bukkit API 的完全访问——且无需 Maven、无需 plugin.yml、无需重启即可测试更改。
由真正的语言引擎驱动,而非自定义伪英文 DSL:GraalJS 用于 JavaScript,LuaJ 用于 Lua,以及 GraalPy 用于 Python。如果你已经掌握上述三种语言中的任意一种,你就已经知道如何编写 BirdLibraryApi 脚本了。
✨ 为什么选择 BirdLibraryApi?
类似 Skript 的脚本方式非常适合快速编辑,但很快会遇到瓶颈。BirdLibraryApi 专为那些想要获得“无需编译”便利性的用户而设计,既不会放弃真正的编程能力,也不会被锁定在单一语言中:
- 自由选择语言 —— 完整的 JavaScript (ECMAScript)、Lua 或 Python,可同时加载。可以在不同脚本间混合使用,也可以仅使用其中一种。
- 无限访问 Bukkit/Paper API —— 即时访问类路径上的任何类:在 JS 中使用
Java.type("..."),在 Lua 中使用 luajava.bindClass("..."),在 Python 中使用 java.type("...")。永远不需要额外的附加组件。
- 安全、细粒度的重载 —— 只重载单个脚本而不影响其他脚本。每个脚本注册的监听器、命令和定时任务都会自动清理。
- 清晰的错误提示 —— 语法和运行时错误会在重载时直接报告到聊天窗口,并附带文件名和行号。损坏的脚本绝不会导致插件崩溃或影响你的其他脚本。
- 内置互联网访问 ——
Bird.fetch(...) 用于 REST API,并预置了 Discord Webhook/embed 支持。
? 开箱即用的功能
- 事件与命令 —— 通过单个函数调用注册,无需
plugin.yml 条目
- 调度器 —— 同步/异步任务,重载时自动取消,此外还有仅异步的
sleep() 用于实现类似 Skript 的等待序列
- 玩家与世界辅助工具 —— 生命值、食物值、药水效果、游戏模式、传送、附近玩家、延迟(ping)、UUID 等
- 聊天、动作栏与标题 —— 内置对
&/§ 颜色代码的支持
- 物品、声音与粒子 —— 一行代码即可实现自定义名称物品、音效和粒子爆发
- 持久化存储 —— 每脚本独立的键值数据存储,以及沙盒化的文件读写功能,用于 JSON 导出、日志和小规模“数据库”
- 冷却系统 —— 适用于技能、命令或任何需要按玩家进行速率限制的场景
? 快速开始
- 将
BirdLibraryApi.jar 放入 plugins/ 目录
- 启动一次服务器 ——
plugins/BirdApi/ 会自动创建
- 在该文件夹中添加一个
.js、.lua 或 .py 脚本
- 运行
/birdlib reload —— 无需重启服务器
JavaScript
Bird.onCommand("hello", function (sender, label, args) {
sender.sendMessage("Hi " + args.length + " args");
});
Bird.onEvent("org.bukkit.event.player.PlayerJoinEvent", function (event) {
Bird.sendTitle(event.getPlayer(), "&6&lWelcome!", "&7Glad you're here");
});
Lua
Bird:onCommand("hello", "", function(sender, label, args)
sender:sendMessage("Hi " .. #args .. " args")
end, function(sender, alias, args) return nil end)
Bird:onEvent("org.bukkit.event.player.PlayerJoinEvent", function(event)
Bird:sendTitle(event:getPlayer(), "&6&lWelcome!", "&7Glad you're here")
end)
Python
def hello(sender, label, args):
sender.sendMessage("Hi " + str(len(args)) + " args")
Bird.onCommand("hello", hello)
def on_join(event):
Bird.sendTitle(event.getPlayer(), "&6&lWelcome!", "&7Glad you're here")
Bird.onEvent("org.bukkit.event.player.PlayerJoinEvent", on_join)
? 文档与 Wiki
完整的 API 参考、示例和指南:
✅ 兼容性
- 服务端软件: Paper(及其分支)
- 要求: Java 17+
- 无其他插件依赖 —— GraalJS、LuaJ 和 GraalPy 均已直接打包进 jar 文件中
? 支持
发现 Bug 或有功能建议?请提交 Issue 或通过上方链接前往“报告问题”页面反馈。

BirdLibraryApi turns your server into a live scripting platform — in JavaScript, Lua, or Python, whichever you already know. Drop a .js, .lua, or .py file into plugins/BirdApi/, and you've got a working plugin — events, commands, timers, and full access to the Bukkit API — with zero Maven, zero plugin.yml, zero restarts to test changes.
Powered by real language engines, not a custom pseudo-English DSL: GraalJS for JavaScript, LuaJ for Lua, and GraalPy for Python. If you already know any of the three, you already know how to write BirdLibraryApi scripts.
✨ Why BirdLibraryApi?
Skript-style scripting is great for quick edits, but it hits a ceiling fast. BirdLibraryApi is built for people who want that same "no compiling needed" convenience, without giving up real programming — and without being locked into one language:
- Pick your language — full JavaScript (ECMAScript), Lua, or Python, all loaded side by side. Mix and match across scripts, or stick to just one.
- Unlimited Bukkit/Paper API access — reach any class on the classpath instantly:
Java.type("...") in JS, luajava.bindClass("...") in Lua, java.type("...") in Python. No addon required, ever.
- Safe, granular reloading — reload one script without touching the others. Every listener, command, and scheduled task a script registers is cleaned up automatically.
- Readable errors — syntax and runtime errors are reported straight to chat when you reload, with file name and line number. A broken script never takes down the plugin or your other scripts.
- Built-in internet access —
Bird.fetch(...) for REST APIs, plus ready-made Discord webhook/embed support.
? What you get out of the box
- Events & commands — register with a single function call, no
plugin.yml entry needed
- Scheduler — sync/async tasks, auto-cancelled on reload, plus an async-only
sleep() for Skript-style wait sequences
- Player & world helpers — health, food, potion effects, gamemode, teleport, nearby players, ping, UUIDs, and more
- Chat, action bar & titles — with
&/§ color code support built in
- Items, sounds & particles — one-liners for custom-named items, sound effects, particle bursts
- Persistent storage — per-script key/value data store, plus sandboxed file read/write for JSON exports, logs, and small "databases"
- Cooldown system — for abilities, commands, anything you need to rate-limit per player
? Getting started
- Drop
BirdLibraryApi.jar into plugins/
- Start your server once —
plugins/BirdApi/ is created automatically
- Add a
.js, .lua, or .py script to that folder
- Run
/birdlib reload — no restart needed
JavaScript
Bird.onCommand("hello", function (sender, label, args) {
sender.sendMessage("Hi " + args.length + " args");
});
Bird.onEvent("org.bukkit.event.player.PlayerJoinEvent", function (event) {
Bird.sendTitle(event.getPlayer(), "&6&lWelcome!", "&7Glad you're here");
});
Lua
Bird:onCommand("hello", "", function(sender, label, args)
sender:sendMessage("Hi " .. #args .. " args")
end, function(sender, alias, args) return nil end)
Bird:onEvent("org.bukkit.event.player.PlayerJoinEvent", function(event)
Bird:sendTitle(event:getPlayer(), "&6&lWelcome!", "&7Glad you're here")
end)
Python
def hello(sender, label, args):
sender.sendMessage("Hi " + str(len(args)) + " args")
Bird.onCommand("hello", hello)
def on_join(event):
Bird.sendTitle(event.getPlayer(), "&6&lWelcome!", "&7Glad you're here")
Bird.onEvent("org.bukkit.event.player.PlayerJoinEvent", on_join)
? Documentation & Wiki
Full API reference, examples, and guides:
✅ Compatibility
- Server software: Paper (and forks)
- Requires: Java 17+
- No other plugin dependencies — GraalJS, LuaJ, and GraalPy are all shaded directly into the jar
? Support
Found a bug or have a feature request? Open an issue or drop by the Report issues linked above.
评论 0
登录后参与评分
还没有评论,来抢沙发吧