About

位置 (-1920,8,-191)

呼び出し元 毎tick実行するコマンド群2

ネザースターの取得時の処理や、マルチプレイ時の距離による経験値取得制限を行う。

コマンド群

No. コマンド
1 /scoreboard players set @a[score_GotExpFlag_min=1] GotExpFlag 0
2 /clear @a[score_GotExpFlag=-1] minecraft:nether_star
3 /execute @a[score_GotExpFlag_min=1] ~ ~ ~ /scoreboard players operation @a[c=1] ExpMessageFlag = @a[r=50,score_HP_min=1,score_Level_min=1,c=1] Level
4 /execute @a[score_GotExpFlag_min=1,score_ExpMessageFlag_min=1] ~ ~ ~ /scoreboard players operation @a[r=50,score_HP_min=1,score_Level_min=1] ExpToLevel -= @a[c=1] GotExpFlag
5 /execute @a[score_GotExpFlag_min=1,score_ExpMessageFlag_min=1] ~ ~ ~ /tellraw @a {“translate”:”%1$sは%2$sEXPの経験値を得た。”,”color”:”yellow”,”with”:[{“selector”:”@a[r=50,score_HP_min=1,score_Level_min=1]”},{“score”:{“name”:”@a[c=1]”,”objective”:”GotExpFlag”},”color”:”white”,”bold”:”true”}]}
6 /scoreboard players reset @a[score_ExpMessageFlag_min=1] ExpMessageFlag
7 /execute @a[score_GotExpFlag_min=1] ~ ~ ~ /scoreboard players operation @a[c=1] ExpMessageFlag = @a[rm=50,score_HP_min=1,score_Level_min=1,c=1] Level
8 /execute @a[score_GotExpFlag_min=1,score_ExpMessageFlag_min=1] ~ ~ ~ /tellraw @a {“translate”:”%1$sは離れ過ぎていたため、経験値を得られなかった。”,”color”:”red”,”with”:[{“selector”:”@a[rm=50,score_HP_min=1,score_Level_min=1]”}]}
9 /execute @a[score_GotExpFlag_min=1] ~ ~ ~ /execute @a[r=50,score_HP_min=1,score_Level_min=1] ~ ~ ~ /playsound entity.player.levelup master @a[c=1] ~ ~ ~ 0.3 2
10 /scoreboard players reset @a[score_ExpMessageFlag_min=1] ExpMessageFlag

詳細

  1. GotExpFlagが1以上であるプレイヤーのGotExpFlagを0に設定
  2. GotExpFlagが-1以下であるプレイヤーのインベントリ内のネザースターを消去し、ExpMessageFlagに半径50m以内、HPが1以上、Levelが1以上であるプレイヤーのLevelを代入
  3. GotExpFlagが1以上、ExpMessageFlagが1以上であるプレイヤーから半径50m以内、HPが1以上、Levelが1以上であるプレイヤーのExpToLevelからGotExpFlagを引く
  4. GotExpFlagが1以上、ExpMessageFlagが1以上であるプレイヤーに経験値取得時のメッセージを出す
  5. ExpMessageFlagが1以上であるプレイヤーのExpMessageFlagを0に設定
  6. GotExpFlagが1以上であるプレイヤーのExpMessageFlagから半径50m以上離れていて、HPが1以上、Levelが1以上であるプレイヤーのLevelを引く
  7. GotExpFlagが1以上でExpMessageFlagが1以上であるプレイヤーに経験値取得失敗時のメッセージを表示
  8. GotExpFlagが1以上であるプレイヤーから半径50m以内、HPが1以上、Levelが1以上であるプレイヤーいる座標で音を鳴らす
  9. ExpMessageFlagが1以上であるプレイヤーのExpMessageFlagを0に設定