This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
So, I was trying to make a CTF minigame in my server and tried to run this command in a repeating command block: (execute if entity @a[nbt={Health:1f}] run setblock ~ ~ ~ minecraft:red_banner) but it didn't work when I tried to kill myself. Anyone know how to do this?
the health nbt tag can be a decimal, for example, you could be testing for 1, but the health is something like 1.0000001
if you use a health scoreboard, it will round the health to an int, so first, create the scoreboard using:
/scoreboard objectives add health health
then, change your command to:
execute as @a[scores={health=0}] at @s run setblock ~ ~ ~ minecraft:red_banner
summon minecraft:armor_stand ~ ~0.5 ~ {NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:leather_boots,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_leggings,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_chestplate,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:player_head,Count:1b,tag:{SkullOwner:"Rocker09871",display:{Name:'{"text":"ror","color":"yellow"}'}}}],HandItems:[{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}},{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}}],Pose:{RightArm:[-30f,-20f,20f],LeftArm:[-70f,30f],Head:[30f,0f]}}
This helped alot thank you so much however half the time it places the flag and half the time it doesn't, any way I could change this?
So, I was trying to make a CTF minigame in my server and tried to run this command in a repeating command block: (execute if entity @a[nbt={Health:1f}] run setblock ~ ~ ~ minecraft:red_banner) but it didn't work when I tried to kill myself.
Anyone know how to do this?
the health nbt tag can be a decimal, for example, you could be testing for 1, but the health is something like 1.0000001
if you use a health scoreboard, it will round the health to an int, so first, create the scoreboard using:
then, change your command to:
summon minecraft:armor_stand ~ ~0.5 ~ {NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:leather_boots,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_leggings,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_chestplate,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:player_head,Count:1b,tag:{SkullOwner:"Rocker09871",display:{Name:'{"text":"ror","color":"yellow"}'}}}],HandItems:[{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}},{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}}],Pose:{RightArm:[-30f,-20f,20f],LeftArm:[-70f,30f],Head:[30f,0f]}}
This helped alot thank you so much however half the time it places the flag and half the time it doesn't, any way I could change this?