☢️操作
通过需求,您可以定义成功和失败后的操作。以下是可以执行的操作列表。
示例: 您需要像这样创建操作列表:
success_actions:
- type: player_command
commands:
- "firstcommand"
- "seconds commands %player%"
- type: console_command
commands:
- "firstcommand"
- "seconds commands %player%"
- type: message
messages:
- "firstcommand"
- "seconds commands %player%"
您可以为列表中的每个项目添加延迟(以 ticks 为单位)。这样做:
success_actions:
- type: player_command
delay: 10 # 10 ticks
commands:
- "firstcommand"
- "seconds commands %player%"
操作
描述
- type: player_command
commands:
- "firstcommand"
- "seconds commands %player%"
commandInChat: false # 默认值为 false
以玩家身份执行指令。您也可以将指令发送到玩家的聊天中。
- type: console_command
commands:
- "firstcommand"
- "seconds commands %player%"
以控制台身份执行指令。
- type: message
messages:
- "my message"
- "my second messages"
minimessage: true # 默认值为 true
发送消息给玩家。您可以使用占位符、颜色代码和格式代码。如果您的服务器支持 MiniMessage 格式,默认启用。
- type: broadcast
messages:
- "my message"
- "my second message to %player%"
minimessage: true # 默认值为 true
向所有在线玩家发送消息。您可以使用占位符、颜色代码和格式代码。如果您的服务器支持 MiniMessage 格式,默认启用。
- type: chat
messages:
- "my message"
代表玩家发送消息。您可以使用占位符、颜色代码和格式代码。如果您的服务器支持 MiniMessage 格式,默认启用。
- type: close
关闭玩家的菜单。
- type: inventory
inventory: <inventory name>
plugin: <plugin name>
page: <page>
arguments: <argument list>
打开 zMenu 的菜单。
- type: connect
server: <server name>
允许将玩家发送到另一个服务器,仅在 BungeeCord 和 Velocity 上有效。
- type: sound
sound: <xsound>
pitch: <sound pitch> # 默认值为 1.0f
volume: <sound volume> # 默认值为 1.0f
向玩家发送声音,您必须使用 XSound 来处理声音。
- type: broadcast_sound
sound: <xsound>
pitch: <sound pitch> # 默认值为 1.0f
volume: <sound volume> # 默认值为 1.0f
向所有在线玩家发送声音,您必须使用 XSound 来处理声音。
- type: data
action: <SET/REMOVE/ADD/SUBTRACT>
key: <data key>
value: <data value>
seconds: <expire seconds> # 默认值为 0
更新 玩家数据。
- type: refresh
刷新当前按钮。仅在点击需求中有效。
- type: back
返回到上一个菜单。
- type: shopkeeper
name: <shopkeeper name>
打开一个 Shopkeeper 交易菜单
- type: book
author: "Maxlego08" # 书的作者
title: "&cTest" # 书的标题
lines: # 书的页面
1: # 第一个页面
- ' #34ebe8zMenu'
- ''
- ''
- '<hover:show_text:"#34eba8Open an url !"><click:open_url:"https://minecraft-inventory-builder.com/">#f0af24Open URL<reset>'
为玩家打开一本书。您可以指定书的标题、作者和页面。
- type: actionbar
message: "my message"
minimessage: true # 默认值为 true
允许您在玩家的动作栏中发送消息。您可以在这里使用占位符和颜色/格式代码。如果您的服务器支持 MiniMessage 格式,默认启用。
- type: withdraw
amount: <amount>
允许从玩家账户中提取金钱。与 Vault 一起使用。
- type: deposit
amount: <amount>
允许将金钱存入玩家账户。与 Vault 一起使用。
Last updated