Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 132
    • Issues 132
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Skills
    • Mechanics
  • command

command · Changes

Page history
Update command authored May 30, 2023 by Lxlp's avatar Lxlp
Hide whitespace changes
Inline Side-by-side
Showing with 35 additions and 27 deletions
+35 -27
  • skills/mechanics/command.md skills/mechanics/command.md +35 -27
  • No files found.
skills/mechanics/command.md
View page @ 9932e2ba
Mechanic: Command
=================
## Description
Executes a command for each target supplied.
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
quotes " or curly brackets {} and must be substitued with their
respective [message variables](/skills/Placeholders#special-characters). For a more
in-depth tutorial on how to use command-skills see [command-skills
tutorial](/tutorials/commandskills). That happens because the double
respective [message variables](/skills/Placeholders#special-characters).
That happens because the double
quotes and curly brackets are reserved for MythicMobs itself trying to
read the syntax you supplied.
Attributes
----------
| Attribute | Aliases | Description | Default |
|---------------|---------|--------------------------------------------------------------------------|---------|
| command | c | The command to execute | |
| 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 |
| asTarget | at | Will execute the command as the targeted entity | false |
| requireTarget | rt | Only executes if the skill has a target | false |
## Attributes
| Attribute | Aliases | Description | Default |
|-----------|-----------|----------------------------------------------------------------------|---------|
| command | c, cmd | The command to execute | |
| asCaster | ac, caster, sudo, asmob| 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 |
| 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
Skills:
- command{c="give <target.name> gold_ingot 20"} @trigger ~onInteract
- 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 ~ ~ ~ {NoAI:true,CustomName:<&dq>Summoned Zombie<&dq>}"}
- command{c="say HELLO <target.name>";asTarget=true;asOp=true} @NearestPlayer{r=10}
```yaml
Skills:
- command{c="give <target.name> gold_ingot 20"} @trigger ~onInteract
- 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 ~ ~ ~ {NoAI:true,CustomName:<&dq>Summoned Zombie<&dq>}"}
- command{c="say HELLO <target.name>";asTarget=true;asOp=true} @NearestPlayer{r=10}
```
### Invalid command-skills
The below example(s) won't work because certain symbols haven't been
substituted with message variables.
```yaml
Skills:
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:"Summoned Zombie"}"}
```
##
Skills:
- command{c="minecraft:summon Zombie ~ ~ ~ {NoAI:true,CustomName:"Summoned Zombie"}"}
### **Making a player execute a command**
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
---------
......
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
FAQ / Common Issues
Mythic Add-ons
Compatible Plugins
API Information
Packs
Mobs
  • Mob Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Extra: Disguises
  • Extra: ModelEngine
Skills
  • Mechanics
  • Effects
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Placeholders
  • Variables
  • Math
Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework
Drops & DropTables
  • Drop Types
Spawning
  • Spawners
  • Random Spawns
Examples