How to Make an Enemy Health Display with Command Blocks in Minecraft (Java Edition Tutorial)
This is a simple and easy method I found that lets you quickly and conveniently show an entity's health. # ================================================ Commands used: Setup Commands: /tag @e[] add hc_hp_monster /scoreboard objectives add hc_hp dummy Chain Commands: /execute at @e[tag=hc_hp_monster] if block ~ ~ ~ air run setblock ~ ~ ~ minecraft:oak_sign /execute as @e[tag=hc_hp_monster] store result score @s hc_hp run data get entity @s Health /execute as @e[tag=hc_hp_monster] at @s run data modify block ~ ~ ~ Text1 set value '[{"score":{"objective":"hc_hp","name":"@e[tag=hc_hp_monster,sort=nearest,limit=1]"}},{"text":" ❤","color":"red"}]' /execute as @e[tag=hc_hp_monster] at @s run data modify entity @s CustomName set from block ~ ~ ~ Text1 /execute at @e[tag=hc_hp_monster] if block ~ ~ ~ oak_sign run setblock ~ ~ ~ air Name modifying command: /execute as @e[tag=hc_hp_monster] run data modify entity @s CustomNameVisible set value 1 # ================================================ My Social Media: Youtube: https://www.youtube/henrycat Reddit: https://www.reddit.com/user/Henry_Cat735 Twitch: https://www.twitch.tv/henry_cat735 Discord: Henry_Cat#5446 (Leave me a comment if you friend me so I know who it is) # ================================================ Used to make this (I recommend these if you want to make your own videos! Most of them are free): Video recording: OBS (https://obsproject.com/) Editing: DaVinci Resolve (https://www.blackmagicdesign.com/products/davinciresolve/)
This is a simple and easy method I found that lets you quickly and conveniently show an entity's health. # ================================================ Commands used: Setup Commands: /tag @e[] add hc_hp_monster /scoreboard objectives add hc_hp dummy Chain Commands: /execute at @e[tag=hc_hp_monster] if block ~ ~ ~ air run setblock ~ ~ ~ minecraft:oak_sign /execute as @e[tag=hc_hp_monster] store result score @s hc_hp run data get entity @s Health /execute as @e[tag=hc_hp_monster] at @s run data modify block ~ ~ ~ Text1 set value '[{"score":{"objective":"hc_hp","name":"@e[tag=hc_hp_monster,sort=nearest,limit=1]"}},{"text":" ❤","color":"red"}]' /execute as @e[tag=hc_hp_monster] at @s run data modify entity @s CustomName set from block ~ ~ ~ Text1 /execute at @e[tag=hc_hp_monster] if block ~ ~ ~ oak_sign run setblock ~ ~ ~ air Name modifying command: /execute as @e[tag=hc_hp_monster] run data modify entity @s CustomNameVisible set value 1 # ================================================ My Social Media: Youtube: https://www.youtube/henrycat Reddit: https://www.reddit.com/user/Henry_Cat735 Twitch: https://www.twitch.tv/henry_cat735 Discord: Henry_Cat#5446 (Leave me a comment if you friend me so I know who it is) # ================================================ Used to make this (I recommend these if you want to make your own videos! Most of them are free): Video recording: OBS (https://obsproject.com/) Editing: DaVinci Resolve (https://www.blackmagicdesign.com/products/davinciresolve/)