Minecraft Blogs / Tutorial

How do selectors work?

  • 530 views, 1 today
  • 4
  • 2
  • 4
Siem_72's Avatar Siem_72
Level 32 : Artisan Pokemon
17
In this tutorial I show you how to use selectors.

This is useful if you want to give an item only to people in team red, or kill everything except for yourself.

Examples:

/kill @a
Kills every player.

/kill @p
Kills the nearest player.

/kill @r
Kills a random player.

/kill @e
Kills all entities. (This includes not only mobs and players, but also armor stands and item frames.)

/kill @e[]
Kills only certain entities.

/kill @e[type=Creeper]
Kills all creepers.

/kill @e[name=Bomby]
Kills every entity named Bomby.

/kill @e[type=Creeper,name=Bomby]
Kills every creeper called Bomby.

/kill @e[type=!Player]
Kills every entity that is not a player.

/kill @a[team=red]
Kills everyone in team red.

/kill @a[team=!red]
Kills everyone that is not in team red.

/kill @a[score_Tutorial_min=1]
Kills everyone with a minimum score of 1 for objective Tutorial.

/kill @a[score_Tutorial=1]
Kills everyone with a maximum score of 1 for objective Tutorial.

/kill @a[score_Tutorial=1,score_Tutorial_min=1]
Kills everyone with a score of 1 for objective Tutorial.
Tags

Create an account or sign in to comment.

1
06/13/2015 9:25 am
Level 22 : Expert Pirate
chrisdude011
chrisdude011's Avatar
Could you please explain why this does not work.
/execute @p[score_OpenDoor_min=0,max=0] ~ ~ ~ /say hi
If i have a score of 2 it still says hi and i want it to run only if a player has a score of 0
1
06/13/2015 12:52 pm
Level 32 : Artisan Pokemon
Siem_72
Siem_72's Avatar
Yes, Pepijn is right. I've added it, thank you!
1
06/13/2015 10:03 am
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
execute @p[score_OpenDoor_min=0,score_OpenDoor=0] ~ ~ ~ say hi

there's no such thing as max=0. score_OBJECTIVE= is essentially a maximum.
1
06/13/2015 4:40 pm
Level 22 : Expert Pirate
chrisdude011
chrisdude011's Avatar
Ahhh right thxs! I have been stuck with this problem for a few days
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome