メインコンテンツまでスキップ

クリック時の動作

EasyMenu 6では、アイテムをクリックしたときの処理をactionへ種類ごとに書けます。

従来のcommandも使用できますが、新しく作るメニューではactionをおすすめします。

Player command

action:
type: player-command
command: "spawn"

type: commandも同じ動作です。

先頭の/は付けても付けなくても構いません。

別のメニューを開く

action:
type: open-menu
menu: shop

menuにはsub/shop.ymlのようなpathではなく、ファイル名から.ymlを除いたIDを書きます。

メッセージを表示する

action:
type: message
message: "&aショップを開きます。"

メニューを閉じる

action:
type: close-menu

複数の動作を実行する

actionsを使うと、上から順番に複数の動作を実行します。

actions:
- type: message
message: "&aロビーへ移動します。"
- type: player-command
command: "spawn"

actionactionsは同時に使用できません。

チャットで入力してもらう

action:
type: input
prompt: "送金額を入力してください。"
input-type: integer
min: 1
max: 1000000
timeout-seconds: 60
command: "money pay admin {input}"

Playerが入力した値は{input}へ入ります。

項目説明
prompt入力をお願いするメッセージ
input-typestringintegerdecimalのいずれか
min数値入力の最小値
max数値入力の最大値
timeout-seconds入力を待つ秒数。1以上が必要
command入力後に実行するPlayer command。{input}が必要

入力中にcancelと送信すると中止できます。

時間切れ、server退出、新しい入力開始のいずれかが起きると、古い入力受付は終了します。

設定が重なった場合

組み合わせ結果
commandactionactionを使用し、warningを表示
actionactions設定エラーとしてreloadを中止
locationslotslotを使用し、warningを表示

設定エラーでreloadが失敗しても、それまで使用していたメニューは消えません。