screen
概要
screen は、プレイヤーの画面にタイトルを表示する ScriptEvent です。
タイトルとサブタイトルを表示し、表示時間を細かく設定できます。
構文
/scriptevent capi:screen <パラメータ>
パラメータ
パラメータはJSON形式またはESON形式で指定できます:
- ESON
- JSON
{title=タイトル,subtitle=サブタイトル,options={in=フェードイン時間,out=フェードアウト時間,stay=表示時間}}
{
"title": "タイトル",
"subtitle": "サブタイトル",
"options": {
"in": フェードイン時間,
"out": フェードアウト時間,
"stay": 表示時間
}
}
| パラメータ | 説明 | 必須 |
|---|---|---|
title | 表示するタイトル | ✓ |
subtitle | 表示するサブタイトル | × |
options | 表示オプション | × |
options パラメータ
| オプション | 説明 | 必須(optionsを使う場合) |
|---|---|---|
in | フェードイン時間(tick) | ✓ |
out | フェードアウト時間(tick) | ✓ |
stay | 表示時間(tick) | ✓ |
tick について
1秒 = 20 tick です。例えば、2秒間表示したい場合は 40 を指定します。
使用例
シンプルなタイトル
タイトルのみを表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=Welcome!}
/execute as @a run scriptevent capi:screen {"title": "Welcome!"}
タイトルとサブタイトル
タイトルとサブタイトルを表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§6ゲーム開始,subtitle=§7頑張ってください!}
/execute as @a run scriptevent capi:screen {
"title": "§6ゲーム開始",
"subtitle": "§7頑張ってください!"
}
表示時間を指定
フェードイン、表示、フェードアウトの時間を指定します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§cカウントダウン,options= {in= 10,out= 10,stay= 40}}
/execute as @a run scriptevent capi:screen {
"title": "§cカウントダウン",
"options": {
"in": 10,
"out": 10,
"stay": 40
}
}
長時間の表示
5秒間表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§6重要なお知らせ,subtitle=§7イベントが開始されました,options= {in= 20,out= 20,stay= 100}}
/execute as @a run scriptevent capi:screen {
"title": "§6重要なお知らせ",
"subtitle": "§7イベントが開始されました",
"options": {
"in": 20,
"out": 20,
"stay": 100
}
}
素早い表示
素早くフェードイン・アウトします。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§c警告!,options= {in= 5,out= 5,stay= 20}}
/execute as @a run scriptevent capi:screen {
"title": "§c警告!",
"options": {
"in": 5,
"out": 5,
"stay": 20
}
}
プレイヤー名を含むタイトル
マクロを使用してプレイヤー名を含めます。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=ようこそ,subtitle=<!name>さん}
/execute as @a run scriptevent capi:screen {
"title": "ようこそ",
"subtitle": "<!name>さん"
}
Name マクロ
../Macro/Name
スコアを含むタイトル
スコアを表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§6レベルアップ!,subtitle=レベル <!score=capi:level>}
/execute as @a run scriptevent capi:screen {
"title": "§6レベルアップ!",
"subtitle": "レベル <!score=player_level>"
}
Score マクロ
../Macro/Score
カウントダウン表示
カウントダウンを表示します(繰り返し実行が必要)。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§c3}
# 1秒待機
/execute as @a run scriptevent capi:screen {title=§c2}
# 1秒待機
/execute as @a run scriptevent capi:screen {title=§c1}
# 1秒待機
/execute as @a run scriptevent capi:screen {title=§aスタート!}
/execute as @a run scriptevent capi:screen {"title": "§c3"}
# 1秒待機
/execute as @a run scriptevent capi:screen {"title": "§c2"}
# 1秒待機
/execute as @a run scriptevent capi:screen {"title": "§c1"}
# 1秒待機
/execute as @a run scriptevent capi:screen {"title": "§aスタート!"}
ゲーム終了の表示
ゲーム終了時に表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§6ゲーム終了,subtitle=§7お疲れ様でした,options={in=20,out=40,stay=60}}
/execute as @a run scriptevent capi:screen {
"title": "§6ゲーム終了",
"subtitle": "§7お疲れ様でした",
"options": {
"in": 20,
"out": 40,
"stay": 60
}
}
勝利の表示
勝者を表示します。
- ESON
- JSON
/execute as @a run scriptevent capi:screen {title=§6§l勝利!,subtitle=<!name>の勝利です!,options={in=10,out=20,stay=80}}
/execute as @a run scriptevent capi:screen {
"title": "§6§l勝利!",
"subtitle": "<!name>の勝利です!",
"options": {
"in": 10,
"out": 20,
"stay": 80
}
}
Name マクロ
../Macro/Name
注意事項
- プレイヤーのみが実行できます
titleパラメータは必須ですoptionsを指定する場合、in、out、stayの全てが必須です- 時間は tick 単位で指定します(1秒 = 20 tick)
- マクロを使用して動的にタイトルを生成できます