|
Mechanic: Command
|
|
## Description
|
|
=================
|
|
|
|
|
|
|
|
Executes a command for each target supplied.
|
|
Executes a command for each target supplied.
|
|
|
|
|
|
Color codes and variables are allowed. For a list of color codes look
|
|
Color codes and variables are allowed. For a list of color codes look
|
... | @@ -9,45 +7,55 @@ Color codes and variables are allowed. For a list of color codes look |
... | @@ -9,45 +7,55 @@ Color codes and variables are allowed. For a list of color codes look |
|
|
|
|
|
The command specified will not function correctly if it contains double
|
|
The command specified will not function correctly if it contains double
|
|
quotes " or curly brackets {} and must be substitued with their
|
|
quotes " or curly brackets {} and must be substitued with their
|
|
respective [message variables](/skills/Placeholders#special-characters). For a more
|
|
respective [message variables](/skills/Placeholders#special-characters).
|
|
in-depth tutorial on how to use command-skills see [command-skills
|
|
That happens because the double
|
|
tutorial](/tutorials/commandskills). That happens because the double
|
|
|
|
quotes and curly brackets are reserved for MythicMobs itself trying to
|
|
quotes and curly brackets are reserved for MythicMobs itself trying to
|
|
read the syntax you supplied.
|
|
read the syntax you supplied.
|
|
|
|
|
|
Attributes
|
|
|
|
----------
|
|
|
|
|
|
|
|
| Attribute | Aliases | Description | Default |
|
|
## Attributes
|
|
|---------------|---------|--------------------------------------------------------------------------|---------|
|
|
|
|
| command | c | The command to execute | |
|
|
| Attribute | Aliases | Description | Default |
|
|
| asCaster | ac | If true the command will execute from the caster instead of the console. | false |
|
|
|-----------|-----------|----------------------------------------------------------------------|---------|
|
|
| asOp | op | Whether to execute the command with all permissions | false |
|
|
| command | c, cmd | The command to execute | |
|
|
| asTarget | at | Will execute the command as the targeted entity | false |
|
|
| asCaster | ac, caster, sudo, asmob| If true the command will execute from the caster instead of the console. | false |
|
|
| requireTarget | rt | Only executes if the skill has a target | false |
|
|
| asOp | op | Whether to execute the command with all permissions | false |
|
|
|
|
| asTarget | at, target, sudotarget| Will execute the command as the targeted entity | false |
|
|
|
|
| requireTarget | rt | Only executes if the skill has a target | asTarget's value|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples
|
|
## Examples
|
|
--------
|
|
|
|
|
|
|
|
### Correctly written command-skills
|
|
### Correctly written command-skills
|
|
|
|
```yaml
|
|
Skills:
|
|
Skills:
|
|
- command{c="give <target.name> gold_ingot 20"} @trigger ~onInteract
|
|
- command{c="give <target.name> gold_ingot 20"} @trigger ~onInteract
|
|
- command{c="minecraft:tp <target.name> <mob.uuid>"} @self ~onDamaged
|
|
- command{c="minecraft:tp <target.name> <mob.uuid>"} @self ~onDamaged
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ <&lc>NoAI:true,CustomName:<&dq>Summoned Zombie<&dq><&rc>"}
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ <&lc>NoAI:true,CustomName:<&dq>Summoned Zombie<&dq><&rc>"}
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:<&dq>Summoned Zombie<&dq>}"}
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:<&dq>Summoned Zombie<&dq>}"}
|
|
- command{c="say HELLO <target.name>";asTarget=true;asOp=true} @NearestPlayer{r=10}
|
|
- command{c="say HELLO <target.name>";asTarget=true;asOp=true} @NearestPlayer{r=10}
|
|
|
|
```
|
|
|
|
|
|
### Invalid command-skills
|
|
### Invalid command-skills
|
|
|
|
|
|
The below example(s) won't work because certain symbols haven't been
|
|
The below example(s) won't work because certain symbols haven't been
|
|
substituted with message variables.
|
|
substituted with message variables.
|
|
|
|
```yaml
|
|
|
|
Skills:
|
|
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:"Summoned Zombie"}"}
|
|
|
|
```
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
Skills:
|
|
### **Making a player execute a command**
|
|
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:"Summoned Zombie"}"}
|
|
This example will execute the "say" commands for the player that interacted with the mob
|
|
|
|
```yaml
|
|
|
|
ExampleMob:
|
|
|
|
Type: ZOMBIE
|
|
|
|
Skills:
|
|
|
|
- command{c="say <target.name>";asTarget=true;asOp=true} @trigger ~onInteract
|
|
|
|
```
|
|
|
|
|
|
Tutorials
|
|
Tutorials
|
|
---------
|
|
---------
|
... | | ... | |