メインコンテンツまでスキップ
バージョン: 2.1.0

title

概要​

title は、プレイヤーの画面にタイトルを表示する ScriptEvent です。
タイトルとサブタイトルを表示し、表示時間を細かく設定できます。

構文​

/scriptevent capi:title <パラメータ>

パラメータ​

パラメータはJSON形式またはESON形式で指定できます:

{title=タイトル,subtitle=サブタイトル,options={in=フェードイン時間,out=フェードアウト時間,stay=表示時間}}
パラメータ説明必須
title表示するタイトル✓
subtitle表示するサブタイトル×
options表示オプション×

options パラメータ​

オプション説明必須(optionsを使う場合)
inフェードイン時間(tick)✓
outフェードアウト時間(tick)✓
stay表示時間(tick)✓
tick について

1秒 = 20 tick です。例えば、2秒間表示したい場合は 40 を指定します。

使用例​

シンプルなタイトル​

タイトルのみを表示します。

/execute as @a run scriptevent capi:title {title=Welcome!}

タイトルとサブタイトル​

タイトルとサブタイトルを表示します。

/execute as @a run scriptevent capi:title {title=§6ゲーム開始,subtitle=§7頑張ってください!}

表示時間を指定​

フェードイン、表示、フェードアウトの時間を指定します。

/execute as @a run scriptevent capi:title {title=§cカウントダウン,options= {in= 10,out= 10,stay= 40}}

長時間の表示​

5秒間表示します。

/execute as @a run scriptevent capi:title {title=§6重要なお知らせ,subtitle=§7イベントが開始されました,options= {in= 20,out= 20,stay= 100}}

素早い表示​

素早くフェードイン・アウトします。

/execute as @a run scriptevent capi:title {title=§c警告!,options= {in= 5,out= 5,stay= 20}}

プレイヤー名を含むタイトル​

マクロを使用してプレイヤー名を含めます。

/execute as @a run scriptevent capi:title {title=ようこそ,subtitle=<!name>さん}

スコアを含むタイトル​

スコアを表示します。

/execute as @a run scriptevent capi:title {title=§6レベルアップ!,subtitle=レベル <!score=capi:level>}

カウントダウン表示​

カウントダウンを表示します(繰り返し実行が必要)。

/execute as @a run scriptevent capi:title {title=§c3}
# 1秒待機
/execute as @a run scriptevent capi:title {title=§c2}
# 1秒待機
/execute as @a run scriptevent capi:title {title=§c1}
# 1秒待機
/execute as @a run scriptevent capi:title {title=§aスタート!}

ゲーム終了の表示​

ゲーム終了時に表示します。

/execute as @a run scriptevent capi:title {title=§6ゲーム終了,subtitle=§7お疲れ様でした,options={in=20,out=40,stay=60}}

勝利の表示​

勝者を表示します。

/execute as @a run scriptevent capi:title {title=§6§l勝利!,subtitle=<!name>の勝利です!,options={in=10,out=20,stay=80}}

注意事項​

  • プレイヤーのみが実行できます
  • title パラメータは必須です
  • options を指定する場合、in、out、stay の全てが必須です
  • 時間は tick 単位で指定します(1秒 = 20 tick)
  • マクロを使用して動的にタイトルを生成できます

関連項目​

  • actionbar - アクションバーにメッセージを表示
  • tell - プレイヤーにメッセージを送信