460: Check highest score in area CHECK DESCRIPTION [Minecraft Map Making]
IMPORTANT NOTE:************
I made a very silly mistake in the commands. Thank you very much to Alexi for pointing it out to me.
The commands in the description have been updated to work, sorry. :(
********************************
Membership:
Ep460: Checking entities in a defined area to see which has the highest health score.
00:00 Intro
00:55 Setup
01:55 Check the health
Version: 1.21.4
Requested by: Happy_oreo
Commands, builds, hacks and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel:
The Discord server I am usually on: https://discord.gg/amU84KykEu
The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.
Commands used:
IMPORTANT NOTE: YouTube does not allow angled brackets in the description. You will have to replace "greater_than" with the corresponding angled bracket.
Setup:
IUN: scoreboard objectives add health dummy
Check:
IUN: execute positioned x y z run tag @e[dx=3, dy=3, dz=3] add check_me
CUA: execute as @e[tag=check_me] store result score @s health run data get entity @s Health
CUA: scoreboard players reset max_health health
CUA: scoreboard players operation max_health health "greather_than" @e[tag=check_me] health
*****Changed commands:
CUA: execute as @e[tag=check_me] unless score @s health = max_health health run tag @s remove check_me
CUA: execute as @e[tag=check_me, limit=1, sort=random] run say I am the Winner!
*****
CUA: tag @e[tag=check_me] remove check_me