Lv機能が作れちゃうコマンド

レッドストーン回路、ピストン、新要素など技術紹介や検証などで盛り上がろう!
  • (PostNo.322541)

Lv機能が作れちゃうコマンド

投稿記事by 紫です » 2018年12月09日(日) 21:18

RPGサーバーとかにあるLv機能が、作れるコマンドです
上限はないです (多分)

内容
次のLvに必要なEXPが0になるとLvUP! みたいな感じです
全バージョン共通コマンド
/scoreboard objectives add EXP dummy
/scoreboard objectives add EXP2 dummy
/scoreboard objectives add EXP4 dummy
/scoreboard objectives add Lv dummy
/title @a actionbar ["",{"text":"Lv:","color":"gold"},{"score":{"name":"@p","objective":"Lv"},"color":"gold"},{"text":" ","color":"dark_red"},{"text":"\u3042\u3068 ","color":"green"},{"score":{"name":"@p","objective":"EXP"},"color":"green"},{"text":"EXP ","color":"green"},{"text":"\u7dcf\u5408EXP:","color":"aqua"},{"score":{"name":"@p","objective":"EXP2"},"color":"aqua"}]
(リピート、ステータスを表示するやつ)

コマンド
~1.12

1 /scoreboard players tag @a[score_EXP=0] add Lvup

2 /scoreboard players add @a[tag=Lvup] Lv 1

3 /title @a[tag=Lvup] title {"text":"§e\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7!"}

4 /title @a[tag=Lvup] subtitle ["",{"text":"§6\u73fe\u5728\u306e\u30ec\u30d9\u30eb:"},{"score":{"name":"@p","objective":"Lv"}}]

5 /scoreboard players operation @a[tag=Lvup] EXP = @a[tag=Lvup] Lv

6 /scoreboard players operation @a[tag=Lvup] EXP *= @a[tag=Lvup] EXP4

7 /scoreboard players tag @a remove Lvup

8 /scoreboard players tag 1@a add EXP {Inventory:[{id:"minecraft:nether_star",tag:{display:{Name:"1EXP"}}}]}
9 /scoreboard players remove @a[tag=EXP] EXP 1

10 /scoreboard players add @a[tag=EXP] EXP2 1

11 /clear @a minecraft:nether_star 0 1 {display:{Name:"1EXP"}}
11.5 /scoreboard players tag @a remove EXP

12 /scoreboard players set @a EXP4 10

1.13~
1 /tag @a[scores={EXP=..0}] add Lvup

2 /scoreboard players add @a[tag=Lvup] Lv 1

3 /title @a subtitle ["",{"text":"\u73fe\u5728 ","color":"gold"},{"score":{"name":"@p","objective":"Lv"},"color":"gold"},{"text":"Lv","color":"gold"}]

4 /title @a title {"text":"\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7!","color":"yellow"}

5 /scoreboard players operation @a[tag=Lvup] EXP = @a[tag=Lvup] Lv

6 /scoreboard players operation @a[tag=Lvup] EXP *= @a[tag=Lvup] EXP4

7 /tag @a remove Lvup

8 /tag @a[nbt={Inventory:[{id:"minecraft:nether_star",tag:{display:{Name:"1EXP"}}}]}] add EXP

9 /scoreboard players remove @a[tag=EXP] EXP 1

10 /scoreboard players add @a[tag=EXP] EXP2 1

11 /clear @a minecraft:nether_star{display:{Name:"1EXP"}} 1

11.5 /tag @a remove EXP

12 /scoreboard players set @a EXP4 10
[/code]
使いかた り→リピート チ→チェーン

1 2 3 4 5 6 7
↓ ↓ ↓ ↓ ↓ ↓ ↓
①りチチチチチチ Lvupについて

 8|9|10|11|11.5
↓ ↓ ↓ ↓ ↓
②りチチチチ EXP関連 (チェーンは条件付き)

 12

③り

/scoreboard players @p set Lv 1 でLvを1にします
/scoreboard players @p set EXP 10 で次のLvに必要なEXPを10にします
/scoreboard players @p set EXP2 0 で総合EXPを0にします
紫です
ID:f6fe2c17
 

Return to テクニック研究/紹介

x