Backbone: Paper 的脚本引擎
运行 Minecraft 服务器时,如果每次小更新、漏洞修复或添加新功能都需要踢出所有玩家并重启服务器,这可能会让人感到沮丧。
Backbone 是一款强大的管理工具,旨在彻底改变你的服务器管理方式。它允许你即时添加自定义功能、物品、菜单和怪物——无需关闭或重启服务器。无论你是试图打造独特体验的服务器所有者,还是希望立即修复问题的管理员,Backbone 都能为你提供让服务器保持在线并使玩家满意的工具。
核心优势
Backbone 简化了服务器定制的重度工作。以下是它能为你的社区带来的好处:
零停机时间更新
Backbone 最大的优势在于其“热重载”引擎。如果你发现自定义功能中存在错误,或者想调整自定义剑的伤害值,你可以更新文件并在游戏内即时重载。服务器将保持在线状态,玩家甚至不会察觉到任何中断。
自定义装备
你不再需要购买昂贵的付费插件来获取自定义装备。Backbone 允许创建具有特殊能力、自定义名称和特定行为的独特物品。你可以轻松地在游戏内生成并将这些物品发放给玩家。
自定义实体
想创建一个静止不动且注视玩家的自定义守卫僵尸,或是独特的Boss怪物吗?Backbone 允许你将自定义行为注入 Minecraft 默认的生物中,从而为玩家创造全新的挑战。
交互式 GUI
创建复杂的箱子菜单(如服务器选择器、商店或属性页面)通常令人头疼。Backbone 简化了这一过程,允许你快速构建外观精美并能即时响应玩家点击的交互菜单。
视觉效果
Backbone 包含一个用于在世界中生成自定义视觉效果的系统,例如围绕玩家的发光方块或自定义全息图,使你的服务器在视觉上脱颖而出。
持久化玩家数据
与旧式插件不同,重新加载可能会导致临时数据丢失,而 Backbone 的设计旨在记住重要信息。如果你有正在运行的实时计数器或特定的玩家状态,Backbone 会在你更新和重载功能时安全地存储这些信息。
入门指南
你不需要是专业开发人员就可以开始从 Backbone 中受益。
要求
- 运行 1.21 或更高版本 的 Minecraft Java Edition 服务器。
- PlaceholderAPI(可选,但建议使用文本占位符)。
安装
- 下载: 从发布页面获取最新的
.jar 文件。
- 安装: 将文件拖放到服务器的
plugins/ 文件夹中。
- 启动: 开启服务器。Backbone 将在主服务器目录中自动创建一个
scripts/ 文件夹。
- 添加功能: 现在,你可以将 Backbone 脚本文件(
.bb.kts)放入该文件夹,即可即时为服务器添加新功能!
脚本示例
Backbone 使用现代化的 Kotlin DSL。以下是一个简单的脚本,展示了如何轻松地跟踪数据和处理事件:
lifecycle {
// 此值 '存活' 于脚本重载之间!
var totalClicks by sustained(0)
onLoad {
println("Backbone feature initialized!")
}
// 即时监听任何 Bukkit 事件
listener<PlayerInteractEvent> { event ->
if (event.action.isLeftClick) {
totalClicks++
event.player.sendMessage("You've clicked $totalClicks times!")
}
}
}
配置
Backbone 的主配置文件位于 config/backbone/backbone.yaml。此文件包含插件的一般设置,例如启用更新检查器。
---
checkForUpdates: true # 启用或禁用更新检查器,该检查器会通知你有新的 Backbone 版本。
loggerCompatibilityMode: false # 如果为 true,Backbone 将不使用新的日志系统,而是通过旧的 Bukkit 记录器进行日志记录。这对于某些不支持新日志系统的主机可能是必要的,但建议保持禁用状态。
管理员命令
Backbone 在游戏中或服务器控制台内管理起来非常简单。使用基础命令 /backbone(或较短的 /bb 别名)来访问这些工具:
杂项
/bb help <command>:获取命令帮助。
/bb check-update:检查更新。
脚本
/bb scripting:查看所有自定义功能的列表,并检查它们当前是否正在运行。
/bb scripting reload:即时应用对文件所做的更改,而无需重启服务器。
/bb scripting enable <name>:启用特定功能。
/bb scripting disable <name>:禁用特定功能。
/bb scripting wipe <name>:完全重置特定功能的保存数据。
/bb scripting probes:列出所有内存泄漏检测探针。
/bb scripting probes check-now:运行内存泄漏检查。
/bb scripting probes clear:清除所有探针。
物品
/bb item:查看当前服务器上加载的所有自定义物品的列表。
/bb item give <name>:给自己一个特定的自定义物品以进行测试。
/bb item replicate:立即复制你手中持有的自定义物品。
/bb item read:扫描你手中持有的物品,查看其隐藏的后台数据。
实体
/bb entity:查看你加载的所有自定义怪物或 NPC 的列表。
/bb entity spawn <name>:在你当前位置直接召唤自定义生物。
/bb entity recreate-goals <radius>:重新加载指定半径内所有自定义实体的所有自定义目标行为。
集成
PlaceholderAPI
如果你在服务器上使用了 PlaceholderAPI,Backbone 会自动支持它!目前你可以在记分板、聊天格式或菜单中使用以下标签:
%backbone_version%:显示你的服务器当前运行的 Backbone 版本。
(更多占位符计划在未来的更新中添加!)
指标
Backbone 通过 bStats(一款开源的 Minecraft 服务器统计收集服务)收集匿名的服务器指标数据。你可以通过编辑 /plugins/bStats/config.yml 选择退出。
所收集的指标数据可在 此处 查看。
Backbone: Scripting Engine for Paper
Running a Minecraft server can be frustrating when every minor update, bug fix, or new feature requires you to kick all your players and restart the server.
Backbone is a powerful administrative tool designed to completely change how you manage your server. It allows you to add custom features, items, menus, and monsters on the fly—without ever shutting down or restarting your server. Whether you are a server owner trying to create a unique experience or an admin looking to fix things instantly, Backbone gives you the tools to keep your server online and your players happy.
Key Benefits
Backbone takes the heavy lifting out of server customization. Here is what it can do for your community:
Zero-Downtime Updates
The biggest advantage of Backbone is its "hot-reloading" engine. If you find a bug in a custom feature, or want to tweak how much damage a custom sword does, you can update the file and reload it instantly in-game. Your server stays online, and your players won't even notice a hiccup.
Custom Equipment
You no longer need to buy expensive premium plugins to get custom gear. Backbone allows for the creation of unique items with special abilities, custom names, and specific behaviors. You can easily generate and hand these out to players in-game.
Custom Entities
Want to create a custom guard zombie that stands still and looks at players, or a unique boss monster? Backbone lets you inject custom behaviors into Minecraft's default mobs, allowing you to create entirely new challenges for your players.
Interactive GUIs
Creating complex chest menus (like server selectors, shops, or stat pages) is usually a headache. Backbone simplifies this, allowing you to quickly build interactive menus that look great and respond to player clicks instantly.
Visual Effects
Backbone includes a system for generating custom visuals in the world, like glowing boxes around players or custom holograms, making your server stand out visually.
Persistent Player Data
Unlike older plugins where reloading might erase temporary data, Backbone is built to remember important things. If you have a live counter or specific player states running, Backbone safely stores that information even while you update and reload your features.
Getting Started
You do not need to be a professional developer to start benefiting from Backbone.
Requirements
- A Minecraft Java Edition Server running version 1.21 or higher.
- PlaceholderAPI (Optional, but recommended for text placeholders).
Installation
- Download: Grab the latest
.jar file from the releases page.
- Install: Drag and drop the file into your server's
plugins/ folder.
- Start: Turn on your server. Backbone will automatically create a
scripts/ folder in your main server directory.
- Add Features: You can now drop Backbone script files (
.bb.kts) into that folder to instantly add new features to your server!
Scripting Example
Backbone uses a modern Kotlin DSL. Below is a simple script showing how easily you can track data and handle events:
lifecycle {
// This value 'survives' script reloads!
var totalClicks by sustained(0)
onLoad {
println("Backbone feature initialized!")
}
// Listen to any Bukkit event instantly
listener<PlayerInteractEvent> { event ->
if (event.action.isLeftClick) {
totalClicks++
event.player.sendMessage("You've clicked $totalClicks times!")
}
}
}
Configuration
Backbone's main config is located at config/backbone/backbone.yaml. This file contains general settings for the plugin, such as enabling the update checker.
---
checkForUpdates: true # Enable or disable the update checker that notifies you of new versions of Backbone.
loggerCompatibilityMode: false # If true, Backbone will not use the new logging system and will instead log through the old Bukkit logger. This may be necessary for certain hosts that do not support the new logging system, but it is recommended to keep this disabled.
Admin Commands
Backbone is incredibly easy to manage from inside the game or your server console. Use the base command /backbone (or the shorter /bb alias) to access these tools:
Misc
/bb help <command>: Get help for a command.
/bb check-update: Check for updates.
Scripting
/bb scripting: See a list of all your custom features and check if they are currently running.
/bb scripting reload: Instantly apply any changes you made to your files without restarting the server.
/bb scripting enable <name>: Turn on a specific feature.
/bb scripting disable <name>: Turn off a specific feature.
/bb scripting wipe <name>: Completely reset the saved data for a specific feature.
/bb scripting probes: List all memory leak detection probes.
/bb scripting probes check-now: Run a memory leak check.
/bb scripting probes clear: Clear all probes.
Items
/bb item: View a list of all the custom items currently loaded on your server.
/bb item give <name>: Give yourself a specific custom item to test it out.
/bb item replicate: Instantly duplicate the custom item you are holding in your hand.
/bb item read: Scan the item you are holding to see its hidden background data.
Entities
/bb entity: View a list of all custom monsters or NPCs you have loaded.
/bb entity spawn <name>: Summon the custom mob directly at your current location.
/bb entity recreate-goals <radius>: Reload all custom goals for all custom entities in a given radius.
Integrations
PlaceholderAPI
If you use PlaceholderAPI on your server, Backbone automatically supports it! You can currently use the following tag in your scoreboards, chat formats, or menus:
%backbone_version%: Displays the version of Backbone your server is currently running.
(More placeholders are planned for future updates!)
Metrics
Backbone collects anonymous server metrics via bStats, an open-source statistics collection service for Minecraft servers. You may opt out with in /plugins/bStats/config.yml.
The metrics collected can be found here.
评论 0
登录后参与评分
还没有评论,来抢沙发吧