Now for most of you experienced players, you probably heard of @e, @a, @p, @r and @s. However, have you heard of @initiator? Whether you’re a newbie or skilled player, I’m sure you’ll find this article helpful!
THE SELECTORS
@e
The Minecraft @e selector targets all entities. This will include players, NPCs, mobs, and even minecarts, the end crystals, and boats. You name it!
The @e is useful because you can use it to remove all the entities in a server with /kill @e or do things like select one mob with defined properties, by adding some square brackets behind it, for example: /kill @e[type=player] would kill all players. You could use @a, though. Just replace “player” in the command with something like pigs and it will remove all the pigs in the server.
@s
What about @s? @s targets the person who is running the command. Very useful for giving you extra superpowers!
If you wanted to give yourself 64 Netherite Ingots, you could use this command:
/give @s netherite_ingot 64
this gives the player who is running this command, (yourself) 64 Netherite Ingots! Enjoy your newfound profits!
@a
The Minecraft @a selector targets all players, including yourself and all the other players! Whether it’s a faraway friend or a close comrade, it selects everybody.
The @a is extremely useful. Use it to give everybody (including you) speed powers or flying abilities! To give everybody speed powers, use the command
/effect @a speed 1000 3 true
this will give everybody Speed 3 for 1000 seconds! The true at the end asks you whether to hide particles or not. True means hiding particles, and false means show particles.
@p
Now, let’s take a look at @p. @p targets the nearest player (you can change to entities, if you need). It’s phenomenal!
Here’s another catch… @p will target the nearest player, which is almost always yourself. So unfortunately, you can’t use the @p in a variety of ways like you can with @e, or @a. @p is very limited and can be used if a player is standing inside of you.
@r
Here comes the catch! The @r target is different each time! You can guess, right? It targets a random person inside your server, which can also be you!
@r is special, unlike any other selector. You can use it to do a giveaway in servers (for example giving a diamond to a random person with @r.) If you want to give a random somebody a diamond, use the /give command! It goes like this:
/give @r diamond 1
using this, you can give a random person inside your server 1 diamond!
@initiator
Now, @initiator… you’ve all been waiting for it. @initiator is the most complex, and you need to understand NPCs first.
But with that being said, @initiator targets the person who is interacting with the NPC. If you comment below, I’ll add a separate post explaining NPCs! @initiator is useful because you can use it to trigger more dialogue texts!
OTHER INFORMATION…
- @a, @r, @s, @p and @initiator only work on players. Unfortunately, the only way to target an entity besides players is with @e, so the other selectors are only designed for players.
- Use ! You can use the ! in selectors, too. It might not make sense at first, but think of it as “not”. For example, you can use ! to do this:
/kill @e[type=!player]
Notice how I put a ! in front of player, making it !player? This means that you can target every single entity in the server EXCEPT players. So, in simpler terms, the command basically means:
kill all the entities and exclude players. - Now for my last tip: Use these selectors commonly. Using them many times over and over can help retain the information and help you use them more efficiently.
These powerful selectors can help you keep an eye on your target, whether they’re out of your eye’s sight or in plain sight. They can help you spot all of them with your x-ray eyes!