此数据包在玩家周围添加了一个径向菜单,用于执行任意命令。
要创建命令菜单,首先你需要获取“命令菜单”物品:
loot give @s loot menu:menu
你也可以通过向包含物品的槽位应用此物品修饰符,将任何物品变为“命令菜单”物品:
item modify entity @s <slot> menu:menu/create
然后在容器(箱子 / 陷阱箱 / barrels / 潜影盒)中放入任意物品。这些将成为径向菜单中的图块。中央的槽位会面向玩家,两侧的槽位则背对玩家。
你可以使用现成的带命令的图块,也可以创建自己的图块。对于现成的图块,请使用以下命令:
loot give @s loot menu:tile/<tile>
有两种类型的现成图块:
- static(静态)– 点击该图块时,将为玩家执行普通的命令/函数。
- dynamic(动态)– 可以运行更复杂的命令组合,并且还可以更改玩家所点击的图块。
但除了现成的命令图块外,你还可以创建自己的简单静态图块。
只需使用普通物品(物品名称将显示为图块名称)来创建径向菜单。
现在,用“命令菜单”物品右键点击装有你的图块的容器。随后所有图块将自动加载到命令菜单中,容器将被清空。
若要对图块进行编辑,可以再次右键点击空容器,从而重新读取命令菜单中的所有图块。
现成的图块:
动态图块:
Ender Chest Viewer
显示所有者末影箱的内容。
你只能从末影箱中取出/复制物品。
右键单击 – 从槽位复制 1 个物品。
Shift + 右键单击 – 从此槽位复制所有物品(例如,如果槽位中有 17 个苹果,则会复制 17 个苹果,而不是 64 个)。
左键单击 – 从槽位取出 1 个物品。
Shift + 左键单击 – 从此槽位取出所有物品。
loot give @s loot menu:tile/dynamic/ender_chest
Kit
给予玩家红漆潜影盒中的所有物品。
任何红漆潜影盒都是一个 Kit 图块。
会自动呈现为潜影盒中最后一个物品的形态。
loot give @s loot menu:tile/dynamic/kit
Multi
允许你根据交互方式的不同,使用 4 个静态命令图块。
使用此 Multi 在容器上右键单击,可向容器中写入或从容器中读取所有物品。
不支持动态图块!
自动采用 Bundle 中最后一件物品的形态。因此,如果你在 Bundle 中放置了 5 件物品,你可以自定义图块的显示外观。
右键点击 - 执行第一个图块命令。
Shift + 右键点击 - 执行第二个图块命令。
左键点击 - 执行第三个图块命令。
Shift + 左键点击 - 执行第四个图块命令。
loot give @s loot menu:tile/dynamic/multi
Pin Menu(固定菜单)
允许你将当前的命令菜单固定在当前位置。
固定命令菜单后,你可以通过与中央的固定点进行交互来自定义显示:
右键点击 - 隐藏命令菜单。
Shift + 右键点击 - 平面模式。
左键点击 - 将命令菜单返回给玩家。
Shift + 左键点击 - 隐藏固定点。
loot give @s loot menu:tile/dynamic/pin_menu
Switcher(切换器)
在当前图块上执行命令并自动切换到列表中的下一个图块。
在容器上使用此 Switcher 按 右键点击 可向容器写入/读取所有物品。
你也可以浏览图块列表:
右键点击 - 执行命令并切换到下一个图块。
Shift + 右键点击 - 执行命令并切换到上一个图块。
左键点击 - 跳过当前图块(不执行命令)并切换到下一个图块。
Shift + 左键点击 - 跳过当前图块(不执行命令)并切换到上一个图块。
loot give @s loot menu:tile/dynamic/switcher
Waypoint(信标)
将玩家传送至已保存的坐标。
默认情况下,Waypoint 图块不包含传送点。
第一次 右键点击 将保存当前位置并创建传送点。
传送可在维度之间进行。
随时可以在铁砧上重命名 Waypoint 图块以命名该地点。
loot give @s loot menu:tile/dynamic/waypoint
右键点击 - 创建信标 / 传送。
Shift + 右键点击 - 删除当前信标。
静态图块:
Clear(清除)
清除玩家背包的一部分。
loot give @s loot menu:tile/static/clear/all - 清除所有物品栏
loot give @s loot menu:tile/static/clear/armor - 仅清除护甲栏
loot give @s loot menu:tile/static/clear/hotbar - 清除快捷栏和副手栏
loot give @s loot menu:tile/static/clear/inventory - 清除主物品栏(不含快捷栏)
Dimension(维度)
将玩家传送至指定维度,并保持相同坐标。
这不是安全的传送方式!请使用航点(waypoint)进行传送。
loot give @s loot menu:tile/static/dimension/overworld - 在 Overworld 中传送
loot give @s loot menu:tile/static/dimension/the_nether - 在 The Nether 中传送
loot give @s loot menu:tile/static/dimension/the_end - 在 The End 中传送
效果
对玩家应用一些效果。
loot give @s loot menu:tile/static/effects/clear - 清除所有效果
loot give @s loot menu:tile/static/effects/feed - 完全恢复饱和度
loot give @s loot menu:tile/static/effects/full - 清除效果,恢复饱和度和生命值
loot give @s loot menu:tile/static/effects/heal - 恢复生命值
loot give @s loot menu:tile/static/effects/hunger - 降低饱和度
游戏模式
将玩家切换到指定的游戏模式。
loot give @s loot menu:tile/static/gamemode/adventure - 切换到冒险模式
loot give @s loot menu:tile/static/gamemode/creative - 切换到创造模式
loot give @s loot menu:tile/static/gamemode/spectator - 切换到旁观者模式
loot give @s loot menu:tile/static/gamemode/survival - 切换到生存模式
时间
设置游戏内白天时间。
天数计数器不会重置!
loot give @s loot menu:tile/static/time/day - 将当前白天的天数设置为 1000
loot give @s loot menu:tile/static/time/noon - 将当前白天的天数设置为 6000
loot give @s loot menu:tile/static/time/night - 将当前白天的天数设置为 13000
loot give @s loot menu:tile/static/time/midnight - 将当前白天的天数设置为 18000
loot give @s loot menu:tile/static/time/sync - 使白天时间与游戏时间同步
loot give @s loot menu:tile/static/time/toggle_cycle - 切换 gamerule doDaylightCycle
隐身
为玩家设置隐身效果。
loot give @s loot menu:tile/static/vanish/on - 开启隐身
loot give @s loot menu:tile/static/vanish/off - 关闭隐身
天气
设置天气。
loot give @s loot menu:tile/static/weather/clear - 设置晴天
loot give @s loot menu:tile/static/weather/rain - 设置雨天
loot give @s loot menu:tile/static/weather/thunder - 设置雷暴天
loot give @s loot menu:tile/static/weather/toggle_cycle - 切换 gamerule doWeatherCycle
我创建这个数据包的灵感来自 psycrafteu 在 Reddit 上的这篇 帖子。
This datapack adds a radial menu around the player to run any commands.
To create a Commands Menu you first need to get the Command Menu item:
loot give @s loot menu:menu
You can also turn any item into a Command Menu item by applying this item modifier to the slot with your item:
item modify entity @s <slot> menu:menu/create
Now place any items in the container (chest / trapped_chest / barrel / shulker_box). These will be the tiles in the radial menu. The central slots will be in front of the player, and the side slots will be behind.
You can use ready-made tiles with commands or create your own, for ready-made tiles use this command:
loot give @s loot menu:tile/<tile>
There are two types of ready-made tiles:
- static - the usual command/function will be executed for the player who clicked on the tile.
- dynamic - can run more complex combinations of commands, which can also change the tile on which the player clicked.
But in addition to ready-made command tiles, you can create your own simple static tiles.
Just use a regular item (the item name will be show as the tile name) to create a radial menu.
Now click with the Command Menu item on the container with your tiles. Then all tiles will be automatically loaded into the Command Menu, and the container will be cleared.
You can read all tiles from the Command Menu again for editing by clicking on the empty container.
Ready-made tiles:
Dynamic tiles:
Ender Chest Viewer
Displays the contents of the owner's Ender Chest.
You can only take/copy items from Ender Chest.
Right click - copy 1 item from the slot.
Shift + Right click - copy all items from this slot (for example, if there are 17 apples in a slot, then 17 apples will be copied, not 64).
Left click - take 1 item from the slot.
Shift + Left click - take all items from the slot.
loot give @s loot menu:tile/dynamic/ender_chest
Kit
Gives the player all items from the Red Shulker Box.
Any Red Shulker Box is a Kit Tile.
Automatically takes the form of the last item in Shulker Box.
loot give @s loot menu:tile/dynamic/kit
Multi
Allows you to use 4 static command tiles, depending on the method of interaction.
Press Right click with this Multi on a container to write/read all items from/to the container.
Does not support dynamic tiles!
Automatically takes the form of the last item in the Bundle. Thus, if you place 5 items in a Bundle, you can customize the appearance of the tile.
Right click - run first tile command.
Shift + Right click - run second tile command.
Left click - run third tile command.
Shift + Left click - run fourth tile command.
loot give @s loot menu:tile/dynamic/multi
Pin Menu
Allows you to pin the current Command Menu to the current location.
After the pin Command Menu, you can interact with the central pin to customize the display:
Right click - hide Command Menu.
Shift + Right click - flat mode.
Left click - return Command Menu to player.
Shift + Left click - hide pin.
loot give @s loot menu:tile/dynamic/pin_menu
Switcher
Executes a command on the current tile and automatically switches to the next tile in the list.
Press Right click with this Switcher on a container to write/read all items from/to the container.
You can also navigate through the list of tiles:
Right click - Execute the command and switch to the next one.
Shift + Right click - Execute the command and switch to the previous one.
Left click - Skip the current tile (without running the command) and switch to the next one.
Shift + Left click - Skip the current tile (without running the command) and switch to the previous one.
loot give @s loot menu:tile/dynamic/switcher
Waypoint
Teleports the player to a saved coordinate.
By default, the Waypoint tile does not contain a teleportation point.
The first Right click will save the current position and create a teleportation point.
Teleportation works between dimensions.
At any time you can rename the Waypoint tile on the anvil to name the location.
loot give @s loot menu:tile/dynamic/waypoint
Right click - Создать waypont / телепортировать.
Shift + Right click - Удалить текущий waypoint.
Static tiles:
Clear
Clears part of the player's inventory.
loot give @s loot menu:tile/static/clear/all - clear all inventory
loot give @s loot menu:tile/static/clear/armor - clear only armor
loot give @s loot menu:tile/static/clear/hotbar - clear hotbar and offhand
loot give @s loot menu:tile/static/clear/inventory - clear main inventory (without hotbar)
Dimension
Teleports the player to the specified dimension at the same coordinates.
This is not safe teleportation! Use waypoint for this.
loot give @s loot menu:tile/static/dimension/overworld - teleport in Overworld
loot give @s loot menu:tile/static/dimension/the_nether - teleport in The Nether
loot give @s loot menu:tile/static/dimension/the_end - teleport in The End
Effects
Applies some effects to the player
loot give @s loot menu:tile/static/effects/clear - clear all effects
loot give @s loot menu:tile/static/effects/feed - completely restores saturation
loot give @s loot menu:tile/static/effects/full - clears effects, restores saturation and health
loot give @s loot menu:tile/static/effects/heal - restores health
loot give @s loot menu:tile/static/effects/hunger - drains saturation
Gamemode
Switches the player to the specified gamemode.
loot give @s loot menu:tile/static/gamemode/adventure - switch to adventure mode
loot give @s loot menu:tile/static/gamemode/creative - switch to creative mode
loot give @s loot menu:tile/static/gamemode/spectator - switch to spectator mode
loot give @s loot menu:tile/static/gamemode/survival - switch to survival mode
Time
Set in-game daytime.
The day counter does not reset!
loot give @s loot menu:tile/static/time/day - set daytime current day to 1000
loot give @s loot menu:tile/static/time/noon - set daytime current day to 6000
loot give @s loot menu:tile/static/time/night - set daytime current day to 13000
loot give @s loot menu:tile/static/time/midnight - set daytime current day to 18000
loot give @s loot menu:tile/static/time/sync - sets daytime equal to gametime
loot give @s loot menu:tile/static/time/toggle_cycle - switch gamerule doDaylightCycle
Vanish
Sets invisibility for the player.
loot give @s loot menu:tile/static/vanish/on - vanish on
loot give @s loot menu:tile/static/vanish/off - vanish off
Weather
Set weather.
loot give @s loot menu:tile/static/weather/clear - set clear weather
loot give @s loot menu:tile/static/weather/rain - set rain weather
loot give @s loot menu:tile/static/weather/thunder - set thunder weather
loot give @s loot menu:tile/static/weather/toggle_cycle - switch gamerule doWeatherCycle
I took the idea for creating this datapack from this post on Reddit by psycrafteu.
评论 0
登录后参与评分
还没有评论,来抢沙发吧