RPG Inventory
添加了一个具有更多装备栏位和其他与装备相关机制的新物品栏界面。
扩展物品栏界面
扩展物品栏界面是该模组最显著的功能。
不过,它可以在服务器配置中禁用。这也会禁用所有依赖于此功能的其他特性。
新装备栏位
这些新的装备栏位的工作原理类似于现有的四个护甲栏位。
所有栏位都可以单独配置。这些选项包括:
- 是否启用该栏位
- 是否可见该栏位
- 是否可以手动将物品放入该栏位
- 是否可以手动从该栏位取出物品
- 栏位的位置
在物品栏中可访问的新栏位有:
- 1 个腰带栏位
- 1 个项链栏位
- 2 个戒指栏位(第二个默认禁用)
- 1 个手套栏位
- 1 个肩部栏位
- 1 个遗物栏位
- 1 个职业物品栏位(默认不可见且无法手动交互)
“法术”栏位
还有 8 个“法术”栏位,它们直接由实体属性 rpginventory:active_spell_slot_amount 控制。其值决定了启用了多少个栏位。
default_spell_slot_amount 服务器配置选项控制每个玩家默认激活的法术栏位数量。
法术栏位最初设计用于配合由 Spell Engine 驱动的法术书使用,但它们也可以与其他物品配合使用。
手持栏位重构
这是对现有副手栏位的扩展。新的“手持栏位”正在“替换”当前选中的快捷栏栏位。
两个手持栏位中的物品可以“收起”(通过按下热键),从而再次访问快捷栏栏位。再次按下时,物品会被收起。
收起的物品会在玩家模型上渲染。确切位置可以在客户端配置中进行配置,位于 rpginventory:not_shown_when_in_sheathed_hand 和 rpginventory:not_shown_when_in_sheathed_offhand 物品标签中的物品在这些栏位中时不会被渲染。
当手持栏位重构处于活动状态时,原版的“切换手持物品”热键将被禁用。使用数字键将物品栏中的物品交换到快捷栏仍然有效。
双手姿态
这是一种特殊情况,只有副手被收起。这导致了主手栏位被占用但副手栏位为空的独特情况。
可以通过按下热键来切换双手姿态。如果主手栏位中的物品位于 rpginventory:non_two_handed_items 物品标签中,则无法进行此操作。
双手姿态本身不会启用任何新功能,但像 Better Combat Extension 这样的模组可以利用它。
空手物品
当一只手未被收起,但相应的栏位中没有物品时,玩家的手并非空的。相反,会持有相应“空手栏位”中的物品。
空手栏位始终包含一个名为“Empty Hand Weapon”的物品。这在技术上是一种武器。当安装了 Better Combat 时,这允许进行徒手战斗。
替代手持栏位
这两个栏位可以容纳与普通手持栏位相同的物品,但持有的物品不计为“已装备”(属性修改器/附魔等不生效)。
可以通过按下热键将手持栏位中的物品与相应的替代手持栏位中的物品进行交换。主手和副手有独立的热键。还有一个同时交换两只手的热键。
技术装备栏位
手持栏位重构的机制使用了各种“隐藏”的装备栏位:
- 1 个收起的手持栏位
- 1 个收起的副手栏位
- 1 个空手栏位
- 1 个空副手栏位
- 1 个替代手持栏位
- 1 个替代副手栏位
附加热键设置
手持栏位重构的所有热键动作都有可配置的附加效果:
状态效果界面
活跃且可见的状态效果列在物品栏界面的右侧。它们按类别排序(有害、有益和中性)。效果可以拥有描述(通过在语言文件中为 <effect_translation_key>.description 赋值添加),这也将被显示。
位于 rpginventory:food_effects 效果标签中的效果将在单独的列表中显示。
栏位工具提示
装备栏位现在可以拥有工具提示。仅当栏位和鼠标悬停堆叠均为空时才会显示此功能。可以在客户端配置中禁用此功能。
其他设置和功能
玩家物品栏中的 2x2 合成网格可以禁用。
其他功能
这些功能独立于扩展物品栏界面工作。
进度锁定物品
具有 rpginventory:advancement_locked 组件的物品堆栈有三种不同的“状态”模式之一,该模式保存在组件中。
不同的模式有:
- 'not_unlocked'(未解锁)
- 'unlocked'(已解锁),优先级最低。仅当物品处于此模式时,才能装备和使用该物品。
- 'locked'(已锁定),优先级最高
“advancement_locked”组件有 5 个字符串字段:
-
"unlock_advancement":‘解锁进度’的 ID。如果玩家解锁了该进度,状态将更改为 'unlocked',否则状态为 'not_unlocked'。如果此字段为空字符串,则物品不能处于 'not_unlocked' 状态。
-
"lock_advancement":‘锁定进度’的 ID。如果玩家解锁了该进度,状态将为 'locked'。如果此字段为空字符串,则物品不能处于 'locked' 状态。
-
"not_unlocked_tooltip_text":此字符串在物品状态为“未解锁”时,可选地显示在物品工具提示中。支持本地化。
-
"tooltip_text":此字符串在物品状态为“未解锁”时,可选地显示在物品工具提示中。支持本地化。
-
"locked_tooltip_text":此字符串在物品状态为“未解锁”时,可选地显示在物品工具提示中。支持本地化。
包含状态为“未解锁”或“锁定”的物品的背包槽位,可选择性地显示槽位覆盖层。
独占装备
装备物品可以属于多个“独占装备组”,这些组定义为保存在 rpginventory:exclusive_equipment 数据组件中的字符串。每个组在同一时间只能存在于一个已装备的物品上。如果在其他物品上检测到该组,这些物品将被移入常规背包或掉落在地上。
玩家制作物品
具有 rpginventory:saves_crafting_player 组件的物品堆栈将保存为其制作者的玩家信息。该玩家的名字会显示在物品工具提示的一行中(可在客户端配置中禁用)。
这纯粹是装饰性的。
玩家绑定物品
物品可以绑定到特定玩家。只有绑定的玩家才能使用这些物品。玩家绑定物品会在工具提示中额外显示一行以展示玩家名称。(可在客户端配置中禁用)
包含绑定给其他玩家的物品的背包槽位会有可配置颜色的覆盖层。这可以在客户端配置中禁用。
如何将物品绑定到玩家
如果物品堆栈具有 rpginventory:bounds_to_player 组件,当该物品被放入玩家背包时,它会自动绑定到该玩家。
此时,rpginventory:bounds_to_player 组件将被移除,并替换为 rpginventory:player_bound 组件。该组件会保存玩家档案。
装备限制变更
服务器配置项 allow_equipment_changes 控制是否可以将物品放入或从装备槽位中取出。
当玩家拥有 rpginventory:civilisation 状态效果时,无论配置设置如何,都可以将物品放入或从装备槽位中取出。
当玩家拥有 rpginventory:wilderness 状态效果时,无论配置设置如何,都不能将物品放入或从装备槽位中取出。
具有 rpginventory:ignores_equipment_change_restrictions 组件的物品堆栈将忽略这些限制。
不可用物品
位于 unusable_when_low_durability 物品标签中或具有 rpginventory:unusable_when_low_durability 数据组件的物品,其行为与鞘翅相同。它们在耐久度耗尽时不会消失,而是变得不可用,直到被修复为止。不可用物品有不同的翻译键(默认为原键名 + "_broken")。
包含不可用物品的背包槽位会有可配置颜色的覆盖层。这可以在客户端配置中禁用。
人体模型与预设物品
人体模型是一种方块,拥有类似于玩家装备槽位的存储槽位。放置在这些槽位中的物品构成一个“预设集(load out)”,玩家可以装备这些预设集。装备预设集会用预设集中物品的副本填充玩家的装备槽位。仅填充为空或包含预设集物品的槽位。
可以使用方块实体数据为非创造模式玩家禁用更改和/或装备预设集物品。
预设集物品
根据服务器配置设置,预设集物品将应用 rpginventory:is_destroyed_on_death 或 rpginventory:is_kept_on_death 数据组件之一。
这些物品通常也不能从槽位中取出,除非与人形模型交互。
附加物品工具提示
这些可以在客户端配置中进行配置,包括位置。
- 预设集物品
- 玩家绑定物品(预设集物品中禁用)
- 玩家制作物品(预设集物品中禁用)
- 进度锁物品(预设集物品中禁用)
- 如果物品位于
two_handed_items 物品标签中。
- 物品可以装备的槽位,这由物品标签控制。
PVP 死亡
当拥有 rpginventory:pvp 状态效果的玩家生命值降至零时,他们不会被杀死,而是触发此功能。
效果包括:
- 移除所有状态效果(除了 PVP 效果和
rpginventory:kept_on_pvp_death 状态效果标签中的所有条目)
- 重置玩家资源(生命值、法力值、体力等)
- 将
pvp effect 的放大器减少一级
- 如果新的放大器大于或等于零:
- 将玩家传送至特定位置(默认出生点/世界出生点,安装 Script Blocks 后变更为其“位置访问位置”)
- 如果新的放大器小于零:
死亡时的背包变更
RPG Inventory 添加了几个影响玩家死亡时背包内物品处理的机制。
当原版游戏规则 keep_inventory 设置为 true 时,所有物品都会被保留。
当装备了位于 sacrificed_to_keep_inventory_on_death 物品标签中的物品时(在装备栏、饰品栏或副手槽中),将应用 rpginventory:keep_inventory 状态效果。
当玩家在此状态效果下死亡时,所有位于 sacrificed_to_keep_inventory_on_death 物品标签中的已装备物品将被销毁。其余背包内容将被保留,不受游戏规则和“消失诅咒”等因素影响。
只有在没有牺牲任何物品来保留背包的情况下,才会应用原版附魔“消失诅咒”。
满足以下条件时,剩余物品会被保留:
- 它们具有
rpginventory:is_kept_on_death 组件
- 它们位于
rpginventory:empty_hand_weapons 物品标签中
不保留的物品会在以下条件下被销毁:
- 服务器配置项
destroy_dropped_items_on_death 设置为 true
- 它们拥有
rpginventory:is_destroyed_on_death 组件
剩余物品会正常掉落。
状态效果
当 building_mode_status_effect_identifier 是有效的状态效果标识符且玩家拥有该状态效果时,将忽略若干机制。
- 所有物品均可用于攻击和破坏方块
- 双手行为如同处于鞘中,因此手槽显示的是当前选中快捷栏槽位中的物品,与原版一致。
与其他模组的集成与兼容性
背包属性
可以在物品栏界面中添加一个打开背包界面的按钮。必须禁用 2x2 合成网格。
物品栏大小属性
HUD 中的快捷栏可配置为仅显示启用的快捷栏槽位。
Spell Engine(仅限 1.21.1)
Spell Engine 的状态效果 API 用于在满足特定条件时为玩家应用“隐藏状态效果”的多种机制。
- 当主手物品位于
rpginventory:two_handed_items 物品标签内且副手槽位非空/已鞘化时,玩家无法攻击、使用物品或施放法术。
- 当主手物品不在
rpginventory:attack_items 物品标签内且服务器配置选项 allow_attacking_with_non_attack_items 设置为 false 时,玩家无法攻击。
Player Attribute Screen(仅限 1.21.1)
当安装了 Player Attribute Screen 模组时,RPG Inventory 界面中会激活一个切换属性界面的按钮。
RPG Crafting(仅限 1.21.1)
可以在物品栏界面中添加一个打开手部合成界面的按钮。必须禁用 2x2 合成网格。
Numismatic Overhaul(仅限 1.21.1)
钱包小部件会显示在 RPG Inventory 界面上。
Trinkets(仅限 1.21.1)
饰品槽位会显示在 RPG Inventory 界面上。
所有饰品槽位均带有工具提示。可通过语言文件按以下模式设置:
{
"slot.tooltip.<group_name>.<slot_name>": "Test Slot"
}
当字符串为空时,不会显示任何工具提示。
RPG Inventory
Adds a new inventory screen with more equipment slots and other equipment related mechanics.
Expanded Inventory Screen
The expanded inventory screen is the most prominent feature of this mod.
However, it can be disabled in the server config. This will also disable all other features that depend on it.
New equipment slots
These new equipment slots work similar to the existing four armor slots.
All slots can be configured individually. These options include:
- whether the slot is enabled
- whether the slot is visible
- whether items can be manually placed into the slot
- whether items can be manually taken out of the slot
- the position of the slot
The new slots accessible in the inventory are:
- 1 belt slot
- 1 necklace slot
- 2 ring slots (the second one is disabled by default)
- 1 gloves slot
- 1 shoulders slot
- 1 relic slot
- 1 class item slot (not visible or manually interactable by default)
"Spell" Slots
There are also 8 "spell" slots, which are directly controlled by the "rpginventory:active_spell_slot_amount" entity attribute. Its value determines how many slots are enabled.
The "default_spell_slot_amount" server config option controls the amount of spell slots each player has active by default.
The spell slots were originally designed to be used with spell books powered by Spell Engine, but they work with other items as well.
Hand Slot Overhaul
This is an extension to the existing offhand slot. The new "hand slot" is "replacing" the currently selected hotbar slot.
Items in both hand slots can be "sheathed" (by pressing a hotkey), which gives access to the hotbar slots again. When pressed again, teh items are unsheathed.
Sheathed items are rendered on the player model. The exact position can be configured in the client config and items in the "rpginventory:not_shown_when_in_sheathed_hand" and "rpginventory:not_shown_when_in_sheathed_offhand" item tags are not rendered when in those slots.
The vanilla "Swap Hands" hotkey is disabled while the Hand Slot Overhaul is active. Swapping inventory items into the hotbar using the number keys still works.
Two-handed Stance
This is a special case, where only the offhand is sheathed. This leads to the unique situation where the mainhand slot is occupied, but the offhand slot is empty.
The two-handed stance can be toggled by pressing a hotkey. This is not possible, if the item in the main hand slot is iin the "rpginventory:non_two_handed_items" item tag.
The two-handed stance enables no new functionality on its own, but mods like Better Combat Extension can utilise it.
Empty hand items
When a hand is not sheathed, but the corresponding slot contains no item, the players hand is not empty. The item in the corresponding "empty hand slot" is held instead.
The empty hand slots always contain a item called "Empty Hand Weapon". This is technically a weapon. When Better Combat is installed, this allows for unarmed combat.
Alternative Hand Slots
These two slots can hold the same items as the regular hand slots, but the held items do not count as "equipped" (no attribute modifiers/enchantments/etc take effect).
Items in the hand slots can be swapped with the items in the corresponding alternative hand slots by pressing hotkeys. There are individual keys for the main and the offhand. There is also a hotkey that swaps both hands at the same time.
Technical equipment slots
The mechanics of the Hand Slot Overhaul use various "hidden" equipment slots:
- 1 sheathed hand slot
- 1 sheathed offhand slot
- 1 empty hand slot
- 1 empty offhand slot
- 1 alternative hand slot
- 1 alternative offhand slot
Additional Hotkey Settings
All hotkey actions of the Hand Slot Overhaul have configurable, additional effects:
- applying cooldowns to the items in the corresponding slot
- stamina requirements/costs (if Stamina Attributes is installed)
Status Effect screen
Active and visible status effects are listed on the right side of the inventory screen. They are sorted by their category (harmful, beneficial and neutral). Effects can have a description (added by assigning a value to <effect_translation_key>.description in the lang files), which is also displayed.
Effects in the "rpginventory:food_effects" effect tag are displayed in a separate list.
Slot Tooltips
Equipment slots can now have a tooltip. It is only shown when the slot and the cursor stack are empty. This feature can be disabled in the client config.
Additional settings and features
The 2x2 crafting grid in the player inventory can be disabled.
Additional Features
These features work independently of the Expanded Inventory Screen.
Advancement Locked Items
An item stack that has the "rpginventory:advancement_locked" component has one of 3 different 'status' modes, which is saved in the component.
The different modes are:
- 'not_unlocked'
- 'unlocked', this has the lowest priority. The item can only be equipped and used if the item is in this mode.
- 'locked', this has the highest priority
The "advancement_locked" component has 5 string fields:
-
"unlock_advancement": the id of the 'unlock advancement'. If the player has this advancement unlocked, the status is changed to 'unlocked', if not the status is 'not_unlocked'. If this field is an empty string, the item can't be 'not_unlocked'.
-
"lock_advancement": the id of the 'lock advancement'. If the player has this advancement unlocked, the status is 'locked'. If this field is an empty string, the item can't be 'locked'.
-
"not_unlocked_tooltip_text": this string is optionally displayed in the item tooltip, when the item status is 'not_unlocked'. This supports localization.
-
"tooltip_text": this string is optionally displayed in the item tooltip, when the item status is 'not_unlocked'. This supports localization.
-
"locked_tooltip_text": this string is optionally displayed in the item tooltip, when the item status is 'not_unlocked'. This supports localization.
Inventory slots containing an item with the 'not_unlocked' or 'locked' status modes, can optionally display a slot overlay.
Exclusive Equipment
Equipment items can be part of multiple "exclusive equipment groups", which are defined as strings saved in the "rpginventory:exclusive_equipment" data component. Each group may only be present on one equipped item at any time. If a group is detected on additional items, those items are either moved into the regular inventory or dropped on the ground.
Player Crafted Items
Item stacks that have the "rpginventory:saves_crafting_player" component will save the player, that crafted them. That player is then displayed in a line in the item tooltip (Can be disabled in the client config).
This is purely cosmetic.
Player Bound Items
Items can be bound to a player. Player bound items can only be used by that player. Player bound items have an additional tooltip line that shows the player name. (Can be disabled in the client config)
Inventory slots that contain items bound to another player have an overlay of a configurable color. This can be disabled in the client config.
How to bind an item to a player
If an item stack has the "rpginventory:bounds_to_player" component, the item stack will bind itself to a player when it is placed in a player inventory.
At that point, the "rpginventory:bounds_to_player" component will be removed and the "rpginventory:player_bound" component will be added instead. This component saves a player profile.
Restricted Equipment Changes
The server config setting "allow_equipment_changes" controls, whether items can be put into or removed from equipment slots.
When a player has the "rpginventory:civilisation" status effect items can be put into or removed from equipment slots, regardless of the config setting.
When a player has the "rpginventory:wilderness" status effect items can not be put into or removed from equipment slots, regardless of the config setting.
Item stacks with the "rpginventory:ignores_equipment_change_restrictions" ignore these restrictions.
Unusable Items
Items in the "unusable_when_low_durability" item tag or with the "rpginventory:unusable_when_low_durability" data component have the same behavior as elytra. Instead of getting destroyed when losing all durability, they become unusable until they are repaired. Unusable items have a different translation key (default one + "_broken").
Inventory slots that contain unusable items have an overlay of a configurable color. This can be disabled in the client config.
Mannequins and Load Out Items
Mannequins are blocks that have storage slots similar to the players equipment slots. Items placed in those slots form a 'load out', which can be equipped by players. Equipping a load out fills the players equipment slots with copies of the load out items. Only slots that are empty or contain a load out item are filled.
Changing and/or equipping load out items can be disabled for non-creative players using block entity data.
Load out items
Depending on a server config setting either the "rpginventory:is_destroyed_on_death" or the "rpginventory:is_kept_on_death" data component is applied to load out items.
These items can also normally not be removed from a slot, only when interacting with a mannequin.
Additional Item Tooltips
These can be configured in the client config, including the position.
- load out items
- player bound items (disabled for load out items)
- player crafted items (disabled for load out items)
- advancement locked items (disabled for load out items)
- if an item is in the "two_handed_items" item tag.
- the slots an item can be equipped in, this is controlled by item tags.
PVP Deaths
When the health of a players with the "rpginventory:pvp" status effect reaches zero, they are not killed, but trigger this feature instead.
Effects include:
- remove all status effects (except the pvp effect and all entries of the "rpginventory:kept_on_pvp_death" status effect tag)
- reset players resources (health, mana, stamina, etc.)
- reduce the amplifier of the "pvp effect" by one
- if the new amplifier is greater or equal to zero:
- teleport player to a specific location (spawn point/world spawn by default, changes to Script Blocks' "location access position" when installed)
- if the new amplifier is smaller than zero:
- teleport player to their spawn point/world spawn
Inventory changes on death
RPG Inventory adds several mechanics that influence what happens with the items in the player inventory when the player dies.
When the vanilla "keep_inventory" game rule is set to true, all items are kept.
The "rpginventory:keep_inventory" status effect is applied when an item in the "sacrificed_to_keep_inventory_on_death" item tag is equipped (in an equipment, trinket or the offhand slot).
When the player dies while having that status effect, all equipped items in the "sacrificed_to_keep_inventory_on_death" item tag are destroyed. The rest of the inventory is kept, regardless of game rules and stuff like "Curse of Vanishing".
The vanilla enchantment "Curse of Vanishing" is applied only when no item was sacrificed to keep the inventory.
Remaining items are kept under these conditions:
- they have the "rpginventory:is_kept_on_death" component
- they are in the "rpginventory:empty_hand_weapons" item tag
Items that are not kept, get destroyed under these conditions:
- the server config setting "destroy_dropped_items_on_death" is set to true
- they have the "rpginventory:is_destroyed_on_death" component
Remaining items are dropped like normal.
Status Effects
When "building_mode_status_effect_identifier" is a valid status effect identifier and the player has that status effect, several mechanics are ignored.
- every item can be used to attack and to break blocks
- both hands behave like they are sheathed, so the hand slot contains the item in the selected hotbar slot, like in vanilla.
Integrations and Compatibility With Other Mods
Backpack Attribute
A button that opens the Backpack Screen can be added to the inventory screens. The 2x2 crafting grid has to be disabled.
Inventory Size Attributes
The hotbar in the HUD can be configured to only show enabled hot bar slots.
Spell Engine (1.21.1 only)
Spell Engine's status effect API is used for several mechanics that apply "hidden status effects" to the player when certain conditions are met.
- when the item in the main hand is in the "rpginventory:two_handed_items" item tag and the offhand slot is not empty/sheated, the player can't attack, use the item or cast spells.
- when the item in the main hand is not in the "rpginventory:attack_items" item tag and the 'allow_attacking_with_non_attack_items' server config option is set to false, the player can't attack.
Player Attribute Screen (1.21.1 only)
When the "Player Attribute Screen" mod is installed, a button to toggle the attribute screen is active in the RPG Inventory screen.
RPG Crafting (1.21.1 only)
A button that opens the Hand Crafting Screen can be added to the inventory screens. The 2x2 crafting grid has to be disabled.
Numismatic Overhaul (1.21.1 only)
The purse widget is displayed on the RPG Inventory screen.
Trinkets (1.21.1 only)
Trinket slots are displayed on the RPG Inventory screen.
All trinket slots have a tooltip. It can be set in the lang file with this schema:
{
"slot.tooltip.<group_name>.<slot_name>": "Test Slot"
}
When the string is empty, no tooltip will be shown.
评论 0
登录后参与评分
还没有评论,来抢沙发吧