使用方法
有效 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"}
重置个人物品栏
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 the save_default function 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 the save_custom_layout function 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 the load_default function 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 the load_custom_layout function 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_layout function. This will clear and reset the personal inventory of the executing player.
Example:
/function iss:functions/reset_custom_layout {id:"starter_kit"}
评论 0
登录后参与评分
还没有评论,来抢沙发吧