Dynamic Entities (@)

Dynamic entities are a way of referring to a specific entity in the world (a zombie, a player or a cow).


@s | Self

@s refers to ourselves, the player who is typing the command. To test it, we'll do a /give to ourselves

/give @s iron_sword
GIF

@p | Nearest Player

With this dynamic entity, the command is only applied to the closest player. We will send a message to the closest player with this command.

/say @p Hi!
GIF

@r | Random Player

With this dynamic entity we will kill a random player.

/kill @r

@a | All Players

With this dynamic entity we refer to all players.

/clear @a
GIF

@e | All Entities

This is how we refer to all entities (excluding the player)

/kill @e
GIF

@e[type=] | Specific Entitie

This is how we refer to a specific entity.

/kill @e[type=cow]