跳转至

对话系统🔗


对话命令可以利用专用的命令机制,你可以在此处阅读更多相关信息。

需要主要注意的是,主标签(Label)总是在顶部,这是可选的,然后是可视字段、输入字段和自定义按钮,按这个特定顺序排列。这是由于 Minecraft 处理对话窗口的方式。未来可能会改变。

对话窗口的示例。请记住,你可以有多个文件,并且每个文件内可以有多个对话,以便更好地组织。

welcome:
  Enabled: true
  Label: '{#white}Welcome {#gray}%cmi_user_display_name% {#white}to {#edward}%cmi_user_world_formatted%'
  Description:
    Width: 300
    Lines:
    - '{#green}Best minecraft server on earth!'
    - ''
    - '{#white}We are glad to have you here %cmi_user_display_name%{#white}!'
    - 'If you have any questions, feel free to ask our staff'
  VisualFields:
  - Width: 300
    Lines:
    - '{#brown}Extra info line!'
  Buttons:
    Columns: 3
    List:
    - Label: '{#red}Read The Rules'
      Width: 100
      OpenDialog: license
      Tooltip:
      - '{#red}Read it before starting to play!'
    - Label: '{#green>}Read a joke{#darkgreen<}'
      Width: 100
      OpenDialog: 'randomtext'
    - Label: '{#edward>}Start Playing{#darkgreen<}'
      Width: 100
      Commands:
      - closeinv!
    - Label: '{#blue}Select a thing'
      Width: 100
      OpenDialog: inputexample
    - Label: ''
      Width: 1
    - Label: '{#yellow}Visual examples'
      Width: 100
      OpenDialog: visualexample
    - Label: '{#yellow}Visit Our Website %cmi_user_display_name%'
      Width: 304
      Url: www.zrips.net
  Close:
    Label: '{#pink>}Go Away!{#edward<}'
    Tooltip:
    - '{#pink>}Lets go %cmi_user_display_name%!{#edward<}'
    Commands:
    - 'cmi feed [playerName]'
    Width: 150
visualexample:
  Enabled: true
  Label: '{#white}Visual examples'
  Description:
    Width: 300
    Lines:
    - '{#green}Descrption at the top!'
  VisualFields:
  - Width: 300
    Lines:
    - '{#brown}Extra info line!'
  - Item: Stone;n{{#red}Custom name};e{sharpness:2}
    Text:
      Width: 150
      Lines:
      - '{#green}Item text with some auto wrapping and'
      - ''
      - '{#white}Multiline'
    Width: 16
    Height: 16
    ShowTooltip: true
    ShowDecorations: false
  - Item: potato
    Text:
      Width: 150
      Lines:
      - '{#green}No tooltip on item'
    Width: 16
    Height: 16
    ShowTooltip: false
  - Item: '[ItemInHand]'
    Text:
      Lines:
      - '{#green}%cmi_iteminhand_displayname% {#white}is what you are holding in your hand!'
  Close:
    Label: '{#edward}Go Back!'
    OpenDialog: welcome
    Width: 250
inputexample:
  Enabled: true
  Label: '{#white}Example of inputs'
  Inputs:
  - Label: '{#brown}Pick one'
    Width: 150
    Options:
    - Label: Option A
      OpenDialog: 'randomtext'
    - Label: '{#red}Option B'
      Default: true
      Commands:
      - 'cmi heal [playerName]'
    - Label: Option C
  - Label: 'Select it and get healed on save!'
    OnTrue:
      Commands:
      - cmi heal [playerName]
    OnFalse:
      Commands:
      - msg! [playerName] No free heal for you!
  Buttons:
    Columns: 1
    List:
    - Label: '{#yellow}Save'
      Width: 150
      Save: true
  Close:
    Label: '{#pink}Back'
    OpenDialog: welcome
license:
  Enabled: true
  Label: '{#white}User Agreement'
  VisualFields:
  - Width: 350
    Lines:
    - 'By clicking “Agree with terms” or continuing to play on this server, you solemnly swear that:'
    - ''
    - ''
    - ''
    - '{#white}1. You will not grief, steal, or blow up someone’s house unless they literally begged you to. (And even then, record it for legal reasons.)'
    - '{#nobel}2. You will not hack, fly, X-ray, or teleport through walls like a haunted AI. We like our ghosts dead and our walls solid.'
    - '{#white}3. You agree that admins are always right, especially when they’re wrong. Disputes may be settled in a pit of lava.'
    - '{#nobel}4. You will not spam the chat, unless it’s with memes approved by the Ministry of Silly Blocks™.'
    - '{#white}5. You will build things, not just holes in the ground shaped like something inappropriate.'
    - '{#nobel}6. You will not summon the Wither inside spawn. Seriously. That’s a one-way ticket to banville.'
    - "{#white}7. You accept that lag may happen, creepers may explode, and your pet dog may randomly vanish. It’s Minecraft, not therapy."
    - "{#nobel}8. You promise not to ask for op, creative mode, free diamonds, or the admin’s credit card number."
    - '{#white}9. You accept that this is a game, not a substitute for real-world dominance, revenge, or romance.'
    - "{#nobel}10. You acknowledge that your building may be roasted — gently and with love — if it's a dirt cube."
    - ''
    - ''
    - '{#white}By accepting, you agree to play nice, have fun, and not become the reason we disable TNT again.'
    - ''
    - '{#yellow}Click to enter blocky paradise.'
    - 'Missclick to be gently kicked like a misbehaving parrot.'
  Inputs:
  - Type: Boolean
    Label: 'Agree with terms'
    OnTrue:
      Commands:
      - asConsole! cmi heal [playerName]
      - closeinv!
    OnFalse:
      Commands:
      - asConsole! cmi kick [playerName] You disagreed!
  Close:
    Label: 'Update!'
    Save: true
    Width: 150
  Close:
    Label: 'Update!'
    Save: true
    Width: 150

随机文本🔗

randomtext:
  Enabled: true
  Description:
    Randomize: true
    Lines:
    - "{#yellow}Why did the creeper break up with the skeleton?\n\n{#green}Because he felt blown away!"
    - "{#yellow}Why don't Endermen like jokes?\n\n{#green}They can't take things lightly!"
    - '{#yellow}Why did Steve get lost?\n\n{#green}He didn’t follow the chunky breadcrumbs!'
    - '{#yellow}How does a Minecraft player avoid sunburn?\n\n{#green}Stay in the shade biome!'
    - '{#yellow}Why was the Minecraft player a great musician?\n\n{#green}He had perfect block timing!'
    - '{#yellow}Why did the chicken cross the Nether?\n\n{#green}To get to the other biome!'
    - '{#yellow}How do you start a party in Minecraft?\n\n{#green}You block the creepers!'
    - '{#yellow}Why was the villager so good at trading?\n\n{#green}Because he had emerald standards!'
    - '{#yellow}What do you call a Minecraft celebration?\n\n{#green}A block party!'
    - '{#yellow}What’s a skeleton’s least favorite room?\n\n{#green}The living room!'
  Close:
    Label: 'Back'
    OpenDialog: 'welcome'
    Width: 150

基础商店🔗

buyItemExample:
  Enabled: true
  Label: '{#white}Shop'
  Description:
    Width: 300
    Lines:
    - '<T>{#green}General store</T><H>Buy stuff</H>'
  VisualFields:
  - Item: "[material]"
    Width: 16
    Height: 16
    ShowTooltip: false
  - Width: 250
    Lines:
    - '<T>{#green}Buy %cmi_material_realname_[material]% for {#yellow}%cmi_worth_buy_[material]% {#green}each</T><H>Hover text</H>'
    - '{#green}You have %cmi_material_realname_[material]% X {#yellow}%cmi_user_itemcount_[material]% {#green}in your inventory'
    - '{#green}Your balance {#yellow}%cmi_user_balance_formated%'
  - Width: 300
    Placeholder: '%cmi_user_balance%<%cmi_worthc_buy_[material]%'
    Lines:
    - '{#red}No money!'
  - Width: 300
    Placeholder: '%cmi_worthc_buy_[material]%<=0'
    Lines:
    - '{#yellow}Not for sale!'
  Buttons:
    Columns: 2
    List:
    - Label: 'Buy %cmi_material_realname_[material]% {#gray}x1'
      Placeholder:
      - '%cmi_worthc_buy_[material]%>0'
      - '%cmi_user_balance%>=%cmi_worthc_buy_[material]%'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_buy_[material]%'
      - '{#gray}Click to buy %cmi_material_realname_[material]%'
      Commands:
      - moneycost:%cmi_worthc_buy_[material]%! cmi give [playerName] [material] 1
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]
    - Label: 'Sell %cmi_material_realname_[material]% {#gray}x1'
      Placeholder:
      - '%cmi_worthc_sell_[material]%>0'
      - '%cmi_user_itemcount_[material]%>=1'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_sell_[material]%'
      - '{#gray}Click to sell %cmi_material_realname_[material]%'
      Commands:
      - exactitem:[material]! asConsole! cmi money give [playerName] %cmi_worthc_sell_[material]%
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]
    - Label: 'Buy %cmi_material_realname_[material]% {#gray}x10'
      Placeholder:
      - '%cmi_worthc_buy_[material]%>0'
      - '%cmi_user_balance%>=%cmi_worthc_buy_[material]:10%'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_buy_[material]:10%'
      - '{#gray}Click to buy %cmi_material_realname_[material]%'
      Commands:
      - moneycost:%cmi_worthc_buy_[material]:10%! cmi give [playerName] [material] 10
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]
    - Label: 'Sell %cmi_material_realname_[material]% {#gray}x10'
      Placeholder:
      - '%cmi_worthc_sell_[material]%>0'
      - '%cmi_user_itemcount_[material]%>=10'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_sell_[material]:10%'
      - '{#gray}Click to sell %cmi_material_realname_[material]%'
      Commands:
      - exactitem:[material]:10! asConsole! cmi money give [playerName] %cmi_worthc_sell_[material]:10%
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]
    - Label: 'Buy %cmi_material_realname_[material]% {#gray}x64'
      Placeholder:
      - '%cmi_worthc_buy_[material]%>0'
      - '%cmi_user_balance%>=%cmi_worthc_buy_[material]:64%'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_buy_[material]:64%'
      - '{#gray}Click to buy %cmi_material_realname_[material]%'
      Commands:
      - moneycost:%cmi_worthc_buy_[material]:64%! cmi give [playerName] [material] 64
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]
    - Label: 'Sell %cmi_material_realname_[material]% {#gray}x64'
      Placeholder:
      - '%cmi_worthc_sell_[material]%>0'
      - '%cmi_user_itemcount_[material]%>=64'
      Width: 200
      Tooltip:
      - '{#white}Price:{#yellow} %cmi_worth_sell_[material]:64%'
      - '{#gray}Click to sell %cmi_material_realname_[material]%'
      Commands:
      - exactitem:[material]:64! asConsole! cmi money give [playerName] %cmi_worthc_sell_[material]:64%
      - asConsole! cmi dialogs buyItemExample [playerName] material:[material]

基础结构🔗

textfieldtest:
  Enabled: true
  Label: '{#white}Title text'
  Close:
    Label: '{#pink}Back'
    OpenDialog: welcome

每个对话设置都以它的名称开始,该名称将在命令中或从另一个对话打开此对话时使用。

Enabled: 将定义此对话是否应该被启用。当它设置为 false 时,只有有权限访问 cmi.command.dialogs.disabled 的玩家才能看到它。 Label: 将定义对话窗口的顶部文本。这可以包含占位符,它们将根据查看此窗口的玩家进行翻译。 Permission: 使用此对话窗口所需的权限节点。可选。 Placeholder: 占位符节点,可以定义查看对话/按钮/输入/可视字段的要求。 Close: 一个可选的字段,用于创建关闭按钮,使用与常规按钮相同的选项。如果没有提供,那么就不会有关闭按钮,但你总是可以通过按键盘上的 ESC 键来关闭对话窗口。建议保留此项。请记住,当你按 ESC 键时,Close 按钮的动作将被执行。

条件🔗

对话本身、它的按钮、输入和可视字段都可以附加条件,以指示你是否可以使用它们。你可以请求特定的权限节点或/和特定的占位符值。

  Placeholder: '%cmi_iteminhand_type%==stone'
  Permission: 'any.permission.node'

占位符🔗

 Placeholder: '%cmi_iteminhand_type%==stone'
  Placeholder:
  - '%cmi_worthc_buy_[material]%>0'
  - '%cmi_user_balance%>=%cmi_worthc_buy_[material]%'

Placeholder 部分应该包含一个占位符,其值返回默认值之一,正面:true, yes, on, enable, enabled, 1,负面将是任何不匹配的值。返回值应该是干净的,不带任何颜色代码。或者,你可以定义你想要检查的自定义值,它应该在 == 变量之后定义,例如 '%cmi_user_weather%==sunny',这只有在玩家处于晴朗天气的世界时才允许使用对话。

Placeholder 字段接受通过 dialogs 命令传递的自定义变量。

你可以定义多个占位符作为要求,这意味着玩家需要拥有全部这些占位符才能看到该字段。

可以使用数值,例如 '%cmi_user_stats_kill_entity:Zombie%>=20' 将检查占位符返回值是否等于或高于 20。有效的操作:>= <= > <

权限🔗

 Permission: 'any.permission.node'

玩家需要拥有的任何权限节点才能使用对话或其字段。 如果权限节点以 ! 开头,那么我们将检查玩家是否没有这个权限节点,例如 '!cmi.command.heal',这只会向没有此权限节点的玩家显示字段。

可视字段🔗

  VisualFields:
  - Width: 300
    Lines:
    - '{#brown}Extra info line!'
  - Item: Stone;n{{#red}Custom name};e{sharpness:2}
    Text:
      Width: 150
      Lines:
      - '{#green}Item text with some auto wrapping and'
      - ''
      - '{#white}Multiline'
    Width: 16
    Height: 16
    ShowTooltip: true
    ShowDecorations: false
  - Item: potato
    Text:
      Width: 150
      Lines:
      - '{#green}No tooltip on item'
    Width: 16
    Height: 16
    ShowTooltip: false
  - Item: '[ItemInHand]'
    Text:
      Lines:
      - '{#green}%cmi_iteminhand_displayname% {#white}is what you are holding in your hand!'

文本🔗

  - Width: 300
    Lines:
    - '{#brown}Extra info line!'
Width: 定义文本字段的宽度。如果文本放不下,那么它将被自动换行到下一行。
Permission: 查看此文本所需的权限节点。可选。
Placeholder: 查看此文本所需的占位符节点。可选。
Randomize: 启用后,我们将从提供的行中随机挑选一行。
Lines: 要显示给玩家的行列表,可以包含占位符。可以使用 CText 格式来显示带悬停能力的文本,并在点击时执行命令。

item🔗

  - Item: Stone;n{{#red}Custom name};e{sharpness:2}
    Text:
      Width: 150
      Lines:
      - '{#green}Item text with some auto wrapping and'
      - ''
      - '{#white}Multiline'
    Width: 16
    Height: 16
    ShowTooltip: true
    ShowDecorations: false
  - Item: potato
    Text:
      Width: 150
      Lines:
      - '{#green}No tooltip on item'
    Width: 16
    Height: 16
    ShowTooltip: false
  - Item: '[ItemInHand]'
    Text:
      Lines:
      - '{#green}%cmi_iteminhand_displayname% {#white}is what you are holding in your hand!'
Item: 物品的定义,接受像 Stone;n{{#red}Custom name};e{sharpness:2} 这样的单行物品或 [ItemInHand],它将自动包括玩家主手中的物品。这里可以使用占位符,它们返回格式正确的物品描述。
Permission: 查看此物品所需的权限节点。可选。
Placeholder: 查看此物品所需的占位符节点。可选。
Width/Height: 定义物品字段的大小,请记住,由于 Minecraft 的限制,这只会调整物品图标周围的字段大小,但不会调整实际图标的大小。所以,虽然我们有这些选项,但它们目前没有真正的用处。
ShowTooltip: 将显示或隐藏你悬停时的物品 tooltip 信息。
ShowDecorations: 将显示或隐藏物品 tooltip 中的装饰,这包括像物品的耐久条或物品数量这样的东西。
Text: 包含通用文本字段变量。可以使用 CText 格式来显示带悬停能力的文本,并在点击时执行命令。
Width: 文本字段宽度。
Lines: 要在物品右侧显示的文本行。可以包含占位符。

输入🔗

inputexample:
  Enabled: true
  Label: '{#white}Example of inputs'
  Inputs:
  - Label: '{#brown}Pick one'
    Width: 150
    Options:
    - Label: Option A
      OpenDialog: 'randomtext'
    - Label: '{#red}Option B'
      Default: true
      Commands:
      - 'cmi heal [playerName]'
    - Label: Option C
      Commands:
      - 'msg! [playerName] selected [value]'
  - Label: '{#brown}Select dialog to open'
    Width: 250
    OpenDialog: '[value]'
    Options:
    - Label: '{#white}None'
      Value: none
    - Label: '{#pink}Welcome'
      Value: welcome
    - Label: '{#green}License'
      Value: license
    - Label: '{#red}Visual Example'
      Value: visualexample
  - Label: 'Select it and get healed on save!'
    OnTrue:
      Commands:
      - cmi heal [playerName]
      Value: accepted
    OnFalse:
      Commands:
      - msg! [playerName] No free heal for you as you picked [value]!
      Value: deny!!!!
  - Label: 'Placeholder based'
    Default: '%cmi_maintenance_state%'
    OnTrue:
      Commands:
      - cmi maintenance true
    OnFalse:
      Commands:
      - cmi maintenance false
  - Label: 'Text over input'
    InitialText: 'Initial text to show'
    MaxLength: 256
    MaxLines: 5
    Height: 64
    Width: 350
    Commands:
    - 'msg! [playerName] &2[value]'
  - Type: Text
    Width: 500
    Commands:
    - 'msg! [playerName] &2[value]'
  - InitialText: '%cmi_user_nickname%'
    Width: 250
    MaxLines: 5
    Height: 64
    Commands:
    - 'cmi nick [value] [playerName]'
  - Label: 'Max players %server_max_players%'
    Width: 250
    Start: 0
    End: '%cmi_equationint_{server_max_players}*2%'
    Step: 1
    InitialValue: '%server_max_players%'
    Commands:
    - 'cmi maxplayers [value]'
  Buttons:
    Columns: 1
    List:
    - Label: '{#yellow}Save'
      Width: 150
      Save: true
  Close:
    Label: '{#pink}Back'
    OpenDialog: welcome

在大多数情况下,输入类型会被自动确定,但这需要你为它定义至少一个特定的、唯一的字段。如果类型没有被正确检测,你可以使用 Type 变量手动定义它,有效选项:Singleton, Boolean, Text, Slider。例如:

  - Type: Text

Singleton🔗

  - Label: '{#brown}Pick one'
    Width: 150
    Options:
    - Label: Option A
      OpenDialog: 'randomtext'
    - Label: '{#red}Option B'
      Default: true
      Commands:
      - 'cmi heal [playerName]'
    - Label: Option C
      Commands:
      - 'msg! [playerName] selected [value]'
  - Label: '{#brown}Select dialog to open'
    Width: 250
    OpenDialog: '[value]'
    Options:
    - Label: '{#white}None'
      Value: none
    - Label: '{#pink}Welcome'
      Value: welcome
    - Label: '{#green}License'
      Value: license
    - Label: '{#red}Visual Example'
      Value: visualexample
Label: 为每个按钮选择显示的文本,可选。
Permission: 查看和使用输入所需的权限节点。可选。
Placeholder: 使用此输入所需的占位符节点。可选。
Width: 定义按钮的宽度。
Options: 玩家可以从中选择的选项列表。
    Label: 选项标签,选择时会显示。可以包含占位符。
    Value: 这个单选选择的自定义值,可以在命令或 OpenDialog 中用 [value] 变量使用。
    Commands: 定义当这个选项被选中且保存按钮被按下时要执行的命令。可选字段。
    Default: 如果存在并设置为 true,那么它将被用作选择开始时的默认选项。这是一个完全可选的字段,如果没有提供,我们将使用第一个条目。这个字段可以使用应返回布尔值的占位符,如:1 0 true false。如果多个选项结果为 true,则将使用第一个,如果占位符状态无法确定,那么我们将默认使用第一个选项。

Boolean🔗

  - Label: 'Select it and get healed on save!'
    OnTrue:
      Commands:
      - cmi heal [playerName]
      Value: accepted
    OnFalse:
      Commands:
      - msg! [playerName] No free heal for you as you picked [value]!
      Value: deny!!!!
  - Label: 'Placeholder based'
    Default: '%cmi_maintenance_state%'
    OnTrue:
      Commands:
      - cmi maintenance true
    OnFalse:
      Commands:
      - cmi maintenance false
Label: 要显示在勾选框旁边的文本,这可以是一行或多行。可选字段。
Permission: 查看和使用输入所需的权限节点。可选。
Placeholder: 使用此输入所需的占位符节点。可选。
OnTrue:
    Commands: 当勾选框被选中时要执行的命令列表。可选。
    Value: 这个单选选择的自定义值,可以在命令或 OpenDialog 中用 [value] 变量使用。
OnFalse:
    Commands: 当勾选框未被选中时要执行的命令列表。可选。

Text🔗

  - Type: Text
    Width: 500
    Commands:
    - 'msg! [playerName] &2[value]'
  - InitialText: '%cmi_user_nickname%'
    Width: 250
    MaxLines: 5
    Height: 64
    Commands:
    - 'cmi nick [value] [playerName]'
Label: 要显示在文本字段顶部的文本。可选。
Permission: 查看和使用输入所需的权限节点。可选。
Placeholder: 使用此输入所需的占位符节点。可选。
Initialtext: 要作为初始值显示在文本字段内部的文本。这可以包含像 %cmi_user_nickname% 这样的占位符值,以插入玩家当前的昵称值。
MaxLength: 玩家可以输入到这个字段的最大字符数。
MaxLines: 启用将行换行为多行的选项,在输入文本比输入字段本身更宽的情况下,允许更简单的视觉表示。
Height: 输入字段的高度,可以与 MaxLines 一起使用,以获得适当大小的输入字段。
Width: 输入字段的宽度,如果没有提供,这可能会根据 MaxLength 输入值自动调整,最高可达 512 个单位。
Commands/OpenDialog: 将执行定义好的命令或在按下保存按钮时打开定义好的对话窗口。[value] 变量可用于从文本字段插入一个值。

Slider🔗

  - Label: 'Max players %server_max_players%'
    Width: 250
    Start: 0
    End: '%cmi_equationint_{server_max_players}*2%'
    Step: 1
    InitialValue: '%server_max_players%'
    Commands:
    - 'cmi maxplayers [value]'
Label: 要显示在值左侧的文本。可选。
Permission: 查看和使用输入所需的权限节点。可选。
Placeholder: 使用此输入所需的占位符节点。可选。
Start: 滑块的起始值,可以是像 2.5 这样的小数。可以用返回数字值的占位符定义。
End: 滑块的结束值。可以用返回数字值的占位符定义,例如 '%cmi_equationint_{server_max_players}*2%'。
Step: 滑块调整时的步长,可以是小数值或基于占位符。
InitialValue: 定义滑块初始位置的地方;这应该在 Start 和 End 的范围内。可以用像 %server_max_players% 这样的占位符定义。
Width: 滑块的宽度。
Commands/OpenDialog: 将执行定义好的命令或在按下保存按钮时打开定义好的对话窗口。[value] 变量可用于从文本字段插入一个值。

按钮🔗

  Buttons:
    Columns: 3
    List:
    - Label: '{#red}Read The Rules'
      Width: 100
      OpenDialog: license
      Tooltip:
      - '{#red}Read it before starting to play!'
    - Label: '{#green>}Read a joke{#darkgreen<}'
      Width: 100
      OpenDialog: 'randomtext'
    - Label: '{#edward>}Start Playing{#darkgreen<}'
      Width: 100
      Commands:
      - closeinv!
    - Label: '{#blue}Select a thing'
      Width: 100
      OpenDialog: inputexample
    - Label: ''
      Width: 1
    - Label: '{#yellow}Visual examples'
      Width: 100
      OpenDialog: visualexample
    - Label: '{#yellow}Visit Our Website %cmi_user_display_name%'
      Width: 304
      Url: www.zrips.net
Columns: 定义我们应该有的按钮列数;默认情况下,它将是 1。
Permission: 使用此按钮所需的权限节点。可选。如果玩家没有访问所定义的权限节点,那么按钮将被完全移除,或被替换为 1 像素宽的、什么也不做的按钮,1 像素选项只适用于你有多个按钮列的情况,只是为了保持 UI 的格式和外观。
Placeholder: 使用此按钮所需的占位符节点。可选。
List: 按定义顺序排列的按钮列表,请记住,按钮将按精确顺序放置,每行的按钮数量将始终基于之前的 Columns 选项固定。只有最后几个按钮在数量较少时会被居中。
    Label: 按钮的标签,可以包含占位符。
    Tooltip: 悬停在按钮上时要显示的 tooltip,可以包含颜色代码和占位符。可以由多于一行组成,要么用 \n 分隔,要么在列表中定义。
    Width: 按钮宽度,不小于 1,如果未设置则默认为 250。
    Commands: 点击此按钮时执行的一个或多个命令。支持专用的命令。要在命令中使用玩家名,你可以利用 [playerName] 变量。
    OpenDialog: 命令的替代选项,可以从此打开另一个对话。
    Url: 命令的替代选项,打开提供的 URL 链接。
    Save: 如果以 "true" 这样的值指示,比如 "Save: true",那么在按钮点击时,输入到输入字段中的值将被处理。请记住,这个特定动作默认会作为其次要动作重新打开现有的对话窗口,所以避免用这个条目定义 OpenDialog,以避免不可预测的行为。命令仍然可以在保存按钮点击时执行,除了保存之外。

命令🔗

/cmi dialogs buyitemexample [material]:oakwood

命令可以包含将在对话内部使用的自定义变量,变量本身应该以特定格式定义,如 [customName]:variable,这简单意味着任何 [customName] 的实例都将被替换为 variable。

检查基础商店示例。 如果需要,可以定义多个变量。 (内容由AI生成,仅供参考)