欢迎光临散文网 会员登陆 & 注册

我的世界高级雪球菜单

2023-04-20 19:15 作者:祺天008  | 我要投稿

以下是一个高级雪球菜单的完整指令: ``` /give @p minecraft:command_block ``` 在聊天栏中执行上述指令后,会得到一个命令方块。 将命令方块放在地面上,并打开它的界面。在命令方块的顶部输入以下命令: ``` scoreboard objectives add snowball minecraft.used:minecraft.snowball Snowballs ``` 这个命令将创建一个计分板目标,用于追踪玩家使用雪球的次数。将命令方块的状态设置为“循环”。 再次打开命令方块的界面,并在底部的输入框里输入以下命令: ``` execute as @a[scores={snowball=1..}] run function snowball-menu:menu ``` 这个命令会在玩家使用雪球的次数达到1次或以上时,运行名为“snowball-menu:menu”的函数。现在我们需要创建这个函数。 输入以下指令来创建一个名为“snowball-menu”的数据包: ``` /function snowball-menu:create ``` 将命令方块的执行状态设置为“单次”。 现在我们需要编辑这个数据包,以添加菜单和相应的功能。打开游戏文件夹中的“datapacks”文件夹,然后进入“snowball-menu”文件夹。 在“data/snowball-menu/functions”文件夹中创建一个名为“menu.mcfunction”的文件。在这个文件中,添加以下代码: ``` tellraw @s [{"text":"Snowball Menu\n","color":"aqua","bold":true},{"text":"Choose your option:\n","color":"white"}] scoreboard players reset @s snowball tellraw @s [{"text":"1. Set time to day\n","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/time set day"}},{"text":"2. Set time to night\n","color":"dark_blue","bold":true,"clickEvent":{"action":"run_command","value":"/time set night"}},{"text":"3. Set weather to clear\n","color":"yellow","bold":true,"clickEvent":{"action":"run_command","value":"/weather clear"}},{"text":"4. Set weather to rain\n","color":"gray","bold":true,"clickEvent":{"action":"run_command","value":"/weather rain"}},{"text":"5. Set weather to thunderstorm\n","color":"gold","bold":true,"clickEvent":{"action":"run_command","value":"/weather thunderstorm"}},{"text":"6. Give diamond sword\n","color":"light_purple","bold":true,"clickEvent":{"action":"run_command","value":"/give @s minecraft:diamond_sword"}},{"text":"7. Give bow and arrow\n","color":"red","bold":true,"clickEvent":{"action":"run_command","value":"/give @s minecraft:bow"},"extra":[{"text":" and "},{"text":"64 arrows","color":"red","clickEvent":{"action":"run_command","value":"/give @s minecraft:arrow 64"}}]}] ``` 这个函数将创建一个可交互的菜单,其中包含多个选项。每个选项都对应一个不同的功能,如设置时间、天气或给予玩家物品。 保存文件后,回到游戏中,输入以下指令来重新加载数据包: ``` /reload ``` 现在,当你使用雪球时,会出现一个菜单,其中列出了多个选项。通过点击相应的选项,你可以执行不同的操作。

我的世界高级雪球菜单的评论 (共 条)

分享到微博请遵守国家法律