PaperMC 插件(适用于 1.21.4),用于实现“游戏对象”(Game Objects),即在游戏中特定活动/事件中具有特定用途的物品/令牌,因此需要或受益于特殊的格式设置或保护。
功能
本插件支持以下功能:
物品堆叠锁定
物品堆叠(即背包中的槽位)可以使用密钥进行“锁定”和“解锁”。
锁定物品会添加一个 NBT 标签,使得其他物品(未设置此 NBT 标签)无法与已锁定的物品堆叠在一起。这可以防止即使物品类型和其他属性相同的情况下发生堆叠。例如,这允许设置仅选择使用特定密钥锁定的物品的红石物品过滤器。
此类锁定的目的是防止其他玩家伪造游戏对象,除非他们被特别授权并获得了该密钥。
你可以使用以下命令锁定当前在主手中持有的物品堆叠(“当前持有物品堆叠”)中的物品,其中 <key> 替换为你的密钥:
/go-lock <key>
如果当前持有的物品堆叠已被锁定,你可以使用以下命令移除其锁定,其中 <key> 再次替换为你的密钥:
/go-lock <key>
物品名称格式化
你可以为当前持有物品堆叠的显示物品名称添加/清除格式。
如果你之前已经在铁砧中重命名了该物品,这将正常工作。如果你之前没有在铁砧中重命名该物品,由于技术原因,插件无法知道正确的物品名称,并将尝试从物品 ID “猜测”它。在大多数情况下,这会产生足够好的结果而不成问题;在其他所有情况下,执行此命令后必须重命名该物品。
以下命令将更改当前持有物品堆叠的物品名称格式:
/go-format <option> <option> ...
你可以提供由空格分隔的任意数量的格式选项。它们按照输入到命令中的顺序应用。
格式选项包括:
-
clear,它将移除之前应用的所有格式
-
bold 和 italic,分别以粗体或斜体样式命名
-
以下颜色:
yellow(黄色)
red(红色)
pink(粉色)
purple(紫色)
blue(蓝色)
aqua(青色)
green(绿色)
darkgreen(深绿色)
white(白色)
gray 或 grey(灰色)
black(黑色)
-
magic,用于特殊的类“魔法”隐藏效果
默认情况下,执行此命令不会清除之前的格式(除非传递了 clear),因此传递两个选项等同于先用第一个选项执行命令,然后再用第二个选项执行一次命令。
物品描述(Lore)
你可以为物品添加或更新描述(lore = 解释),当鼠标悬停在物品上时会显示,可能包含关于其来源、用途或功能的信息。
要为当前持有物品堆叠设置描述,请使用以下命令:
/go-lore <text>
要在文本中添加换行符,请使用两个正斜杠(//)。
自定义模型数据
还可以设置(数值型)自定义模型数据,模板可以对此做出反应。这允许仅限于该物品的某些实例覆盖默认纹理。
使用以下命令为当前持有物品堆叠设置自定义模型数据:
/go-custommodel <id>
物品模型覆盖
从 MC 1.21.1 开始,现在可以设置自定义物品模型,例如 "minecraft:diamond",应将其用作默认物品模型的替代。
使用以下命令为当前持有物品堆叠设置物品模型覆盖:
/go-custommodel clear|<namespace>:<item>
附魔光效覆盖
由于 Minecraft 添加了新的结构化组件用于附魔光效覆盖,现在可以使物品始终具有附魔光效(yes)、从不具有附魔光效(no)或遵循默认值(auto)。
使用以下命令为当前持有物品堆叠设置附魔光效覆盖:
/go-glint yes|no|auto
请注意,ID 必须是正整数。
保存/应用
为了简化批量操作,你可以保存上述物品堆叠的游戏对象详细信息,并将其应用到其他物品堆叠。
每组保存的数据都将有一个名称,以便以后访问,并且它仅保存在你的用户配置文件中,即其他人无法访问它。
要保存当前持有物品堆叠的游戏对象数据,请使用以下命令:
/go-save <name> [<key>]
你必须提供一个名称,该名称只能包含小写字母(a-z)、数字(0-9)、下划线(_)和点(.)。
如果当前持有的物品堆叠已被锁定,则必须提供密钥,以防止绕过伪造保护。
要将保存的游戏对象数据应用到当前持有物品堆叠,请使用以下命令:
/go-apply <name>
请注意,如果当前持有物品的名称与游戏对象数据中保存的名称不相等,此命令将失败。这是为了将此功能与铁砧的 vanilla 行为(需要经验等级)区分开来。
安装
要安装此插件,只需将 GameObjectMod-<version>.jar 复制到 PaperMC 安装目录的 plugins/ 文件夹中。
然后重启或重新加载服务器。
权限可以在 ~/plugins/GameObject.Mod/config.yml 中配置。默认情况下所有命令均已启用。服务器操作员将始终能够执行插件命令。
归属与许可
由 luap42 用心开发 <3。
本项目根据 AGPL 第 3 版许可证的条款获得许可。有关更多详细信息,请参阅 LICENSE.txt。
PaperMC plugin (for 1.21.4) for implementing "Game Objects", i. e. items/tokens that serve a specific purpose in an in-game game/event and therefore need/profit from special formatting or protection.
Features
This plugin supports the following features:
Locking of Item Stacks
Item Stacks (i. e. slots in your inventory) can be "locked" and "unlocked" with a secret key.
Locking an item adds an NBT tag, so that other items (that do not have this NBT tag set) cannot stack with the locked items. This prevents stacking of items even if they have the same item type and the same other properties. This allows, for example, setting up an redstone item filter only selecting items locked with a specific secret key.
The purpose of such locking is to prevent other players from forging game objects, unless they have been specifically authorized to do so by being given the secret key.
You can lock the items of the item stack you are currently holding in your main hand ("currently held item stack") using the following command, where <key> is replaced with your secret key:
/go-lock <key>
You can remove the lock of the currently held item stack, if it is locked, using the following command, where <key> is again replaced with your secret key:
/go-lock <key>
Item Name Formatting
You can add/clear formatting for the displayed item name of the currently held item stack.
This will work just fine if you have previously renamed the item in an anvil. If you have not renamed the item in an anvil before, the plugin cannot know the correct item name for technical reasons and will attempt to "guess" it from the item id. In most cases, this produces a good-enough result to not be a problem, in all other cases, the item must be renamed after executing this command.
The following command will change the item name formatting of the currently held item stack:
/go-format <option> <option> ...
You can provide an unlimited amount of formatting options separated by a space. They are applied in the order in which they are entered into the command.
Formatting options are:
-
clear which will remove all previously applied formatting
-
bold and italic which will style the name bold or italic, respectively
-
the following colors:
yellow,
red,
pink,
purple,
blue,
aqua,
green,
darkgreen,
white,
gray or grey,
black
-
magic for a special "magic"-like hidden effect
Executing this command does not clear previous formatting by default (unless clear is passed), so that passing two options is equivalent to executing the command with the first option and then executing it again with the second option.
Item Lore
You can add or update lore (=explanation) to an item, which will be displayed when hovering the item and may contain information about its origin, use or functionality.
To set the lore for the currently held item stack, use the following command:
/go-lore <text>
To add a line break in the text, use two forward slashes (//).
Custom Model Data
It is also possible to set a (numeric) custom model data, which can be reacted to in a template. This allows overriding the default texture for an item limited to certain instances of it.
Set the custom model data for the currently held item stack with the following command:
/go-custommodel <id>
Item Model Override
Starting with MC 1.21.1 it is now possible to set a custom item model, such as "minecraft:diamond" which should be used instead of the default item model.
Set the item model override for the currently held item stack with the following command:
/go-custommodel clear|<namespace>:<item>
Enchantment Glint Override
Since Minecraft added a new structured component for enchantment glint overrides, it is now possible to make an item always have an enchantment glint (yes), to never have an enchantment glint (no) or to defer to the default values (auto).
Set the enchantment glint override for the currently held item stack with the following command:
/go-glint yes|no|auto
Please note that the ID has to be a positive integral number.
Save/Apply
In order to ease batch operations, you can save the aforementioned game object details of an item stack and apply them to other item stacks.
Each saved set of data will have a name under which it can be accessed later and it will be saved only for your user profile, i. e. other people cannot access it.
To save the game object data of the currently held item stack, use the following command:
/go-save <name> [<key>]
You must provide a name, which may only contain lowercase letters (a-z), numbers (0-9), underscores (_) and points (.).
If the currently held item stack has been locked, you must provide the secret key, to prevent circumvention of the forgery protection.
To apply saved game object data to the currently held item stack, use the following command:
/go-apply <name>
Please note, that this command will fail if the name of the currently held item is not equal to the name saved with the game object data. This is to separate this functionality from the vanilla behavior of an anvil (which costs levels).
Installation
To install this plugin, just copy the GameObjectMod-<version>.jar to the plugins/ folder of your PaperMC installation.
Then restart or reload the server.
Permissions can be configured in ~/plugins/GameObject.Mod/config.yml. By default all commands are enabled. Server Operators will always be able to execute plugin commands.
Attribution and License
Developed with <3 by luap42.
This project is licensed under the terms of the AGPL version 3 license. See LICENSE.txt for more details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧