➕ 数据包菜单
- 一个受 ModMenu 启发的数据包,此数据包允许多个数据包在暂停屏幕中共享空间,从而让玩家能够启用/禁用数据包,并进入其特定菜单等。
? 示例:
要使用数据包功能,如果你希望玩家能够从暂停菜单中使用你的菜单,你需要向数据包设置子菜单中添加一个按钮。
data modify storage datapack.menu add.button append value {label:"(按钮名称)",width:120,action:{type:"minecraft:run_command",command:"(你希望运行的命令)"}}
data modify storage datapack.menu add.button append value {label:"(按钮名称)",width:120,action:{type:"minecraft:show_dialog",dialog:"namespace:(对话框命名空间)"}}
data modify storage datapack.menu add.button append value {label:"Datapacks Menu Settings",width:150,action:{type:"minecraft:show_dialog",dialog:"datapack_menu:config"}}
? 指南:
-
在你的数据包中设置此系统时,你只需要运行一个简单的 data modify 命令,这将允许数据包将你添加的按钮合并到设置菜单中。我计划为其他开发者添加更多功能,但目前这是我们拥有的现有系统。
-
关于设置此系统,请复制上述示例并将其添加到你的初始化函数中,然后在重新加载时,此数据包将重新加载并更新存储!
-
对于 运行命令: 示例,我建议设置一个触发器命令,以便非 OP 玩家也可以运行它。为此,我建议根据触发器显示一个对话框,例如:我的另一个数据包 Inventory Pets 有一个命令 /trigger inventory_pets,它会显示一个对话框并允许玩家通过触发器命令运行子命令,如控制声音/粒子设置、打开游戏内 Wiki 并通过此子菜单报告问题。
-
对于 显示对话框: 示例,如果你的数据包中内置了一个简单的对话框,仅引导玩家进行错误报告/指南/卸载功能,那么如果你不需要为非 OP 玩家运行子命令功能,这将更受欢迎。
? 已知问题:
⛳ 其他:
- 有一个名为 Smithed 的数据包具有类似的功能,但据我所知,它是硬编码的,且设置更为复杂。不过,如果你更喜欢那个版本,两者都是可行的选择。
➕ Datapacks-Menu
- A datapack inspired by ModMenu, this datapack allows multiple datapacks to share space in the pause screen allowing players to enable/disable datapacks, and go into their specific menus etc.
? Examples:
To use the datapack features you'll need to add a button to the datapack settings sub-menu if you want players to be able to use your menu from the pause menu.
data modify storage datapack.menu add.button append value {label:"(Button Name)",width:120,action:{type:"minecraft:run_command",command:"(The command you wish to run)"}}
data modify storage datapack.menu add.button append value {label:"(Button Name)",width:120,action:{type:"minecraft:show_dialog",dialog:"namespace:(dialog)"}}
- Built-in Example (The one which comes pre-loaded)
data modify storage datapack.menu add.button append value {label:"Datapacks Menu Settings",width:150,action:{type:"minecraft:show_dialog",dialog:"datapack_menu:config"}}
? Guide:
-
When setting up this system into your datapack you only need to run a simple data modify command, this will allow the datapack to merge the button you add into the settings menu, I do plan on adding more features for other developers, but as of the moment this is the current system we have,
-
As for setting this system up, copy from the prior examples and add it to your setup function, then on reload this datapack will reload and update the storages!
-
With the Run Command: example I suggest having a trigger command so that non-oped players can run this, with this I'd suggest having it show a dialog based on the trigger e.g: My other datapack Inventory Pets has a command /trigger inventory_pets which shows a dialog and allows players to run sub-commands via the trigger commands, like controlling their sound/particle settings, open an in-game wiki and report issues via this sub-menu.
-
With the Show Dialog: Example if you have a simple dialog baked-in your datapack that just leads players to a bug-report/Guide/Uninstall function then this would be more preferable if you don't need players to run sub-command functions for non-oped players.
? Bugs - Issues:
-
Currently this datapack has one major issue which is that if you open the main menu and try to enter the settings sub-menu you need to leave the escape menu and go from there, however with the nature of this pack and how it works I'm unsure of a way to fix it.
-
If you come across any bugs please report them in the issues.
⛳ Misc:
- There is a smithed datapack with similar features however, to my knowledge it's hard coded and a more difficult setup, althought both are viable if you prefer that version,
评论 0
登录后参与评分
还没有评论,来抢沙发吧