1

Help me with an execute command plz

JacobXY_RC 7/24/22 12:42 pm
206
8/7/2022 12:35 pm
so i need to make this command for for my friend so that they can have an active team counter and this does not work:

execute if entity @a[team=1,nbt={Health:0.0}] run kick JacobXY_RC

and it does not kick me from my server and yes I'm on a server so this should work.
Posted by
JacobXY_RC
Level 1 : New Miner
0

  Have something to say?

JoinSign in

10

PaintsplattersMC
07/25/2022 2:56 pm
Level 43 : Master uwu
iirc "kick" command doesn't work in command blocks.



try putting them in spectator mode instead?
2
Radon8472
08/07/2022 12:35 pm
Level 9 : Apprentice Miner
Is you character in a team names 1 ??
1
Silabear
07/25/2022 11:00 am
He/Him • Level 70 : Legendary Guard Bear
history
Try this. Make sure that it is in a repeating command block, always active, and you are on a team called 1 or it would not work.
kick @a[team=1,nbt={DeathTime:1}]
1
JacobXY_RC
07/25/2022 9:50 pm
Level 1 : New Miner
this did not work i did "gamemode spectator @a[team=1,nbt={DeathTime:1}]" instead as to not get repeat kicked if i die but it did not work
1
Silabear
07/26/2022 4:17 am
He/Him • Level 70 : Legendary Guard Bear
Are you sure that you are definitely on a team just called 1?
/team add team 1
/team join 1
1
Dissec
07/24/2022 3:46 pm
Level 21 : Expert Miner
You can try using a scoreboard to store the number of deaths using:
/scoreboard objectives add died deathCount
and then a repeating command block with the following command to reset it to 0
/execute as @a if score @s died matches 1.. run scoreboard players set @s died 0

Now just do:
/execute as @a if entity @s[team=1, scores={died=1}] run kick @s Dead men must be kicked.

That will basically add a scoreboard called dead to store deaths obviously
then set it to 0 if greater or equal than 1
if its greater than 0 will kick the person.
1
JacobXY_RC
07/25/2022 11:01 am
Level 1 : New Miner
since my friend is using a scoreboard they want it to show enemy deaths so i need it to show enemy deaths but probably not same team deaths.
also wouldn't that first command block just make it always 0 for everyone? by putting the death back to 0 for you when you die?
1
Spuduking
07/25/2022 1:26 pm
Level 34 : Artisan Procrastinator
The commands are indeed out of order, so try:

~Execute this once
/scoreboard objectives add died deathCount

~Repeating commands (in order)
kick @a[team=1, scores={died=1..}] Dead men must be kicked.
scoreboard players reset @a[scores={died=1..}] died


This creates a deathCount, then every tick kicks any player on team 1 with 1 or more deaths and then resets their deathCount. I also optimized Dissec's commands
1
Spuduking
07/24/2022 3:40 pm
Level 34 : Artisan Procrastinator
I have a few questions:
  1. What is a team counter?
  2. is the "nbt={Health:0.0}" part to detect whether a player has died? If so, you may consider using a scoreboard objective that counts deaths.
  3. Is the team in question called '1'?
1
JacobXY_RC
07/25/2022 10:57 am
Level 1 : New Miner
so idk what you mean by team counter and the nbt health 0.0 shows the player on team 1's health is 0.0 or they are dead then it should kick them and not let them keep playing after they die and the team is question is yes called 1
1

Welcome