BackpackDisplay
为背包、潜影盒或其他容器物品添加工具提示,以显示其内部内容。
可配置如何获取容器物品的内容。
该模组内置支持原版潜影盒、Storage Drawers 的抽屉以及 Forestry 的背包。你可以通过在模组的配置文件中编写自定义规则来为更多物品添加支持。
可配置选项(参见模组的配置文件):
- 应显示工具提示的物品
- 工具提示的位置和颜色
- 可选的按住或释放按键绑定以显示工具提示
配置格式
displayRules 是模组的主要配置。它允许你添加新的容器物品以显示背包工具提示,格式如下:
格式:<modID>:<itemID>[:meta]#<rule type>#<rule definition>
meta 是一个用于匹配元数据值的逗号分隔列表。
例如,1,2,5-8 允许工具提示显示在具有元数据 1、2、5、6、7、8 的物品上。
当 meta 缺失时,工具提示将忽略元数据显示在该物品上。
规则定义取决于所选的规则类型。
路径
路径常用于规则中,格式类似于 path.to.the.item。
例如,在以下 NBT 结构中:
{"list":[{"key1":"value"},{"key2":"item"}]}
路径 list.1.key2 将从中提取标签 "item"。
列表规则
规则类型:list
在此规则中,所有物品都位于一个 NBTTagList 或 NBTTagCompound 下。
规则定义:path.to.the.list[;path.to.the.itemstack[;path.to.the.counts]]
最后两个路径相对于列表中的标签项而言。
如果 counts 缺失,则使用 itemstack 中的数量。
示例:悬停紫色潜影盒时显示内容
minecraft:purple_shulker_box#list#BlockEntityTag.Items
单一规则
规则类型:single
在此规则中,物品位于固定路径下,并带有可选的外部数量值。
规则定义:path.to.the.itemstack[;path.to.the.counts[;calculations for the counts]]
如果 counts 缺失,则使用 itemstack 中的数量。
示例:显示 Storage Drawers 模组中每个基础抽屉的内容
storagedrawers:basicdrawers:0#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:1,3#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:1,3#single#BlockEntityTag.Drawers.1.Item;BlockEntityTag.Drawers.1.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.1.Item;BlockEntityTag.Drawers.1.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.2.Item;BlockEntityTag.Drawers.2.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.3.Item;BlockEntityTag.Drawers.3.Count
此规则支持进一步计算以获得实际物品数量,如果该数量未直接存在于标签中,但可以从标签中的值计算得出。
计算是以运算符 +-*/^% 开头的字符串,后跟一个路径。计算顺序类似于无法输入表达式的普通计算器。
所有计算均在整数范围内进行。
示例:显示 Storage Drawers 模组中紧凑抽屉的内容
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.0.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.0.Conv
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.1.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.1.Conv
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.2.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.2.Conv
BackpackDisplay
Adds a tooltip to show what's in your backpack, shulker box or other container item.
Configurable of how to get contents for the container item.
The mod has out-of-the-box support for vanilla shulker boxes, storage drawers drawers, and forestry backpacks. You can add support to more items by writing custom rules in the mod's config.
Configurable options(See the mod's config):
- The items that the mod's tooltip should be shown for
- Position and color of the tooltip
- Optional hold or release a keybind to show the tooltip
Config Format
displayRules is the main config of the mod. It lets you to add new container items to display the backpack tooltip, with the following format:
Format: <modID>:<itemID>[:meta]#<rule type>#<rule definition>
meta is a comma-separated list for meta-values to match.
For example,1,2,5-8 allows tooltip to show on the item with metadata 1,2,5,6,7,8.
When meta is absent, tooltip to show on the item ignoring meta.
Rule definition is according to the rule type selected.
Paths
Path is commonly used in the rules, and have a format like path.to.the.item.
For example, in this NBT structure:
{"list":[{"key1":"value"},{"key2":"item"}]}
The path list.1.key2 will get the tag "item" from it.
List rule
Rule type: list
In this rule, items are all under a NBTTagList or a NBTTagCompound.
Rule definition:path.to.the.list[;path.to.the.itemstack[;path.to.the.counts]]
The last 2 paths is relative to the tag item in the list.
If the counts is absent, the count in the itemstack is used instead.
Example: Show contents when hovering a purple shulker box
minecraft:purple_shulker_box#list#BlockEntityTag.Items
Single rule
Rule type: single
In this rule, an item is under a fixed path, with an optional external count value.
Rule definition:path.to.the.itemstack[;path.to.the.counts[;calculations for the counts]]
If the counts is absent, the count in the itemstack is used instead.
Example: Show content for every basic drawers in storage drawers mod
storagedrawers:basicdrawers:0#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:1,3#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:1,3#single#BlockEntityTag.Drawers.1.Item;BlockEntityTag.Drawers.1.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.0.Item;BlockEntityTag.Drawers.0.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.1.Item;BlockEntityTag.Drawers.1.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.2.Item;BlockEntityTag.Drawers.2.Count
storagedrawers:basicdrawers:2,4#single#BlockEntityTag.Drawers.3.Item;BlockEntityTag.Drawers.3.Count
This rule supports further calculation to get the real item count if it's not in the tag directly but can be calculated from the values in the tag.
Calculations are a string starting with a operator in +-*/^% and followed by a path. The order of calculation is like that on a basic calculator that cannot input expressions.
All calculations is done in integer.
Example: Show content for compact drawers in storage drawers mod
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.0.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.0.Conv
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.1.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.1.Conv
storagedrawers:compdrawers#single#BlockEntityTag.Drawers.Items.2.Item;BlockEntityTag.Drawers.Count;/BlockEntityTag.Drawers.Items.2.Conv
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
下载 Backpack Display
修复了因 IndexOutOfBoundsException 导致的崩溃
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
模组
添加全屏世界地图,显示你在世界中已探索的区域。与 Xaero's Minimap 搭配使用效果极佳。
评论 0
登录后参与评分
还没有评论,来抢沙发吧