使用方法
有效 ID
ID 通常可以是任意字符,但建议使用特殊字符是不推荐的,因为这可能导致不可预测的行为。
加载布局
可以通过运行 iss:functions/load/ {id:<your id>} 来实现。
如果玩家没有与该 ID 关联的已保存布局,则会尝试运行定义的回退函数(参见“定义回退函数”)。如果没有为该 ID 定义回退函数,则操作将失败。
你也可以通过运行 iss:functions/load/fallback {id:<your id>} 直接加载已定义的备用函数。
保存
你可以通过运行 iss:functions/save {id:<your id>} 来保存布局,这会将执行该命令的玩家库存保存到指定的 ID。
删除布局
以该玩家的身份运行 iss:functions/delete/ {id:<your id>} 可删除特定玩家的某个布局。
以该玩家的身份运行 iss:functions/delete/all {id:<your id>} 可删除与某 ID 关联的所有布局。
定义回退函数
向某 ID 添加回退函数,请运行 data modify storage iss data.<your id>.fallback set value "<your function path>"。
强烈建议将此命令放入你的加载函数中,因为删除所有布局时也会移除回退函数的数据(此行为可能更改)。
如何使用 [旧版 2.0.0 之前]
库存类型
全局物品栏
全局物品栏作为个人物品栏的备份,独立于各个玩家的数据运行。
个人背包
个人背包与单个玩家绑定。它们最初是为那些希望自定义装备包(区别于默认选项)的玩家设计的,但也可以用于任何目的。如果玩家尝试加载一个尚未保存的个人背包,系统将改为加载对应的全局背包。
保存和加载背包
背包 ID
要保存或加载背包,必须始终提供背包的 ID。请注意,背包 ID 中不允许使用以下字符:
- 空格
- 句号(
.) - 方括号(
[]) - 圆括号(
())
保存与加载
这些命令旨在存储和恢复执行命令的玩家自身的背包内容。
保存
-
全局背包
使用save_default函数保存全局背包,并将所需的 ID 作为参数传入。示例:
/function iss:functions/save_default {id:"starter_kit"} -
个人背包
要保存个人背包,请使用带有 ID 参数的save_custom_layout函数。示例:
/function iss:functions/save_custom_layout {id:"starter_kit"}
加载
加载命令会替换玩家的整个背包内容。
-
全局背包
使用load_default函数加载全局背包,并指定 ID。示例:
/function iss:functions/load_default {id:"starter_kit"} -
个人背包
要加载个人背包,请使用带有 ID 参数的load_custom_layout函数。
示例:
/function iss:functions/load_custom_layout {id:"starter_kit"}
重置个人物品栏
-
若要重置玩家的个人物品栏,请使用
reset_custom_layout函数。这将清除并重置执行该命令的玩家的个人物品栏。示例:
/function iss:functions/reset_custom_layout {id:"starter_kit"}
How to use
Valid IDs
The ID can generally be any character although using special characters is not recommended as this can lead to unpredictable behavior
Loading a Layout
This can be done by running iss:functions/load/ {id:<your id>}
If the player doesn't have a saved Layout tied to the ID it will try to run the defined fallback function(see "Defining a fallback function") if there is no fallback function defined for that ID it will fail
You can also load the defined fallback function directly by running iss:functions/load/fallback {id:<your id>}
Saving
You can save a Layout by running iss:functions/save {id:<your id>}, this will save the Inventory of the player who is executing it to the specified id
Deleting Layouts
To delete a Layout of a spesific player run iss:functions/delete/ {id:<your id>} as the player.
To delete All Layouts associated with a certain id run iss:functions/delete/all {id:<your id>}
Defining a fallback function
To add a fallback function to an id run data modify storage iss data.<your id>.fallback set value "<your function path>"
I Would Highly Recommend that you put the command in your load function as deleting All Layouts will also remove the fallback function data(subject to change)
How to use [old pre 2.0.0]
Inventory Types
Global Inventories
Global inventories serve as a backup for personal inventories, operating independently from individual player data.
Personal Inventories
Personal inventories are linked to individual players. They were originally designed for those who wanted to customize their kits differently from the default options, but they can be used for any purpose. If a player attempts to load a personal inventory that hasn't been saved yet, the corresponding global inventory will be loaded instead.
Saving and Loading Inventories
Inventory Ids
To save or load an inventory, you must always provide the inventory's ID. Note that certain characters are not allowed in the inventory ID, including:
- Spaces
- Periods (
.) - Square brackets (
[]) - Parentheses (
())
Saving & Loading
These commands are designed to store and restore the inventory of the player who executes them.
Saving
-
Global Inventory
Use thesave_defaultfunction to save a global inventory, including the desired ID as an argument.Example:
/function iss:functions/save_default {id:"starter_kit"} -
Personal Inventory
To save a personal inventory, use thesave_custom_layoutfunction with the ID argument.Example:
/function iss:functions/save_custom_layout {id:"starter_kit"}
Loading
Loading commands replace the player's entire inventory.
-
Global Inventory
Use theload_defaultfunction to load a global inventory, specifying the ID.Example:
/function iss:functions/load_default {id:"starter_kit"} -
Personal Inventory
To load a personal inventory, use theload_custom_layoutfunction with the ID argument.Example:
/function iss:functions/load_custom_layout {id:"starter_kit"}
Resetting Personal Inventories
-
To reset a player's personal inventory, use the
reset_custom_layoutfunction. This will clear and reset the personal inventory of the executing player.Example:
/function iss:functions/reset_custom_layout {id:"starter_kit"}
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
下载 ISS
ISS v2.0.0
此次更新将范围从实用工具类型的使用转向更侧重于库的方向
有关新的使用说明,请查看描述或 README 文件
- 从零开始重写代码
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
数据包
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
数据包
此数据包添加了新的“祝福模式”难度。
数据包
允许服务器管理员方便地禁用 Xaero's Map 系列模组中的实体雷达、小地图等功能,使竞技游戏更加公平。
数据包
手持潜影盒时可直接打开,无需将其放置在地面上。只需按住 Shift 并右键点击即可访问你的潜影盒。
数据包
粉色方块中的千种可能!
评论 0
登录后参与评分
还没有评论,来抢沙发吧