![]() |
VOOZH | about |
The execute command is an extremely usefull feature that can use a variety of arguments and selectors to run a command.
Normally, you want to start the comand like this: /execute as (target/selector)
1. "as" executes the command from the perspective of the target 2. The selector specifies a player or an entity. Here are all of the selectors:
@p - The nearest player @s - Yourself @a - All players @r - Random player @e - All entities
You can also use perameters to select a target under certain circumstances. Simply put a set of square brackets next to your selector. Example:
@a[name="DoTheWooley"]
Here are a few peremeters you may want to use:
[r=] - only effects entities within a certain radius. ex: @a[r=20] [name=] - only effects entities with a specific name tag/username. ex: @a[name="DoTheWooley"] [type=] only effects entities of a specific kind. ex: @e[type=pig]
The next part of the command can vary depending on what you want to do: /execute as @a at @s run (command)
"at" can be replaced with any of these:
if entity (target/selector) - only runs the command if it detects the specified entity
if block (block name) (position) - only runs the command if it detects the specified block in the specified position
if score (target/selector) (scoreboard) (=,<,ect.) (amount) - checks for an entity's score
unless - uses the same syntax as "if" but only runs the command is it doesn't detect the specified parameters