# Selector

SporeCore supports **advanced selectors**, similar to the ones used in vanilla Minecraft. You can use the following selectors in commands:

* `@a` → All players
* `@e` → All entities
* `@r` → A random player
* `@p` → Nearest player
* `@s` → The executor of the command (self)

### 🔹 Selector Options

The `@e` selector (and others that support options) allows you to filter targets using **options in brackets**: `@e[option=input]` &#x20;

| Option        | Example value                            | Description                                                                                         |
| ------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------- |
| distance      | <p>5<br>5...10</p>                       | The minimum distance for the action                                                                 |
| gamemode      | <p>creative<br>survival</p>              | What gamemode the target should be in                                                               |
| haspermission | <p>\*<br>sporecore.gamemode.creative</p> | What permission the target needs to have. It only shows a few permissions but all permissions work! |
| limit         | <p>1<br>2</p>                            | The limit for entities/players                                                                      |
| name          | <p>bob<br>jerry</p>                      | The name of the entity that has to match                                                            |
| sort          | <p>south<br>forward</p>                  | In what direction should the action be run for                                                      |
| tag           | <p>invis<br>special</p>                  | What **minecraft** tag the target entities should have                                              |
| type          | <p>player<br>pig<br>zombie</p>           | what entity type should the target be                                                               |
| world         | <p>world<br>world\_the\_end</p>          | In what world the entities should be in.                                                            |

You can also **combine multiple options** by separating them with commas:

```
/gmc @e[type=player,limit=2]
```

In this example:

* `type=player` → Only selects players
* `limit=2` → Limits the selection to 2 targets
