内科専門医 今日もマイクラ処方中

Minecraftの医学的有効性を検証中

MENU

モブの体力をサイドバーに表示する (day414)

モブの体力をサイドバーに表示する。ここではエンダーマンを例にする。

1. healthというobjectを作成

/scoreboard objectives add health dummy

 

2. サイドバーに表示する

/scoreboard objectives setdisplay sidebar health

 

3. 体力(Health)を格納する

コマンドブロック: Repeat, Unconditional, Always active
/execute as @e[type=enderman, limit=1] run execute store result score enderman health run data get entity @s Health