Using command-skills

If you're using Minecraft 1.12 or below, the tutorial can be found here

This tutorial will teach you how to make use of the command-skills in MythicMobs.

First off, a few preparations are to be made to ensure everything will be running correctly. Understand that the contents of the command-skill are run from the servers console, but for some reason are also affected by Minecraft's command blocks. Thankfully though, no command block usage is necessary at all!


Step 1:

Go to your file and enable command blocks. All you have to do for that is setting the line “enable-command-block=” to “true”:


Step 2:

To make sure the changes just made are taking effect, restart or reload the server. Either is fine. Once done with that you're good to go to actually start working with command skills!

General functionality

Command skills are capable of doing anything an admin could do on the server. They also able to create effects/make changes that currently (any point in time) are not available by standard MythicMobs configurations or skills.

If not specified otherwise, command skills will be executed inside of the servers console. That is fine for some commands like setting the time or weather on the server to something specific. Any command that doesn't affect a specific player, entity or location is fine like this. For instance:

- command{c="time set 0"}
- command{c="weather clear"}
- command{c="gamerule doMobSpawning false"}

Complications may arise, when you have multiple plugins using the same syntax - which is actually the case for some of the above examples!

Lots of Bukkit/Spigot servers run the plugin “Bukkit Essentials” which has its own version of the /time and /weather command. If the above skills were to be executed on a server that has said plugin installed on it, the server might execute the essentials version of the command although you meant to use vanilla mincraft version of it. How the server decides which of the commands has priority is unknown to me.

To prevent such issues, we simply have to be a little more detailed when writing our command-skills:

- command{c="minecraft:time set 0"}
- command{c="mincraft:weather clear"}
- command{c="minecraft:tp player1 player2"}
- etc...

I highly want to encourage using the above method. I've worked on some server which had such an overflowing amount of plugins, that certain commands wouldn't work/respond at all if you didn't provide the minecraft: -prefix.

Executing the command from X

Some commands must be executed from a specific entity in order to get the desired effect. This is necessary for all mobs that do not spawn in a predetermined, unique location. I like to call such mobs dynamic mobs.

Let's assume, for the sake of realistic examples, you wanted your mob to encase itself in a box of white wool when it spawns. First off, an approach that would not work:

- command{c="minecraft:fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:white_wool"}

The above cannot work, because the way it is formatted it will attempt to run that command from the console. Since the console does not have a location of its own in the Minecraft world, it cannot fill an area of a 2 block radius around itself with white wool. The command will fail, or if you're unlucky will create a box of wool at the coordinates of the world spawn.

We must use an approach that forces the casting mob to execute that command at its own location. What we need for that is the “execute”-command. Here's how it looks:

- command{c="execute at <mob.uuid> run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:white_wool"}
Now we're talking - that approach will work. The <mob.uuid>-part is a MythicMobs message variable and will paste the casting mobs UUID in the command as soon as the command is run. This way, the command is no longer run from the console but rather from the location of the casting mob, which is exactly what we needed.

The same could be achieved like this:

- command{c="execute at <target.uuid> run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:white_wool"} @self

<target.uuid>will always relate to the targeter used on the skill. In this case, the @self targeter at the very end of the line. However, you can also make certain mobs or any other targets for that matter execute the above skill!:

- command{c="execute at <target.uuid> run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:white_wool"} **@MobsInRadius{r=10;t=BAT}**

The above will encase all bats in a 10 block radius from the casting in 2-block radius white wool box. As I said, best example.

Here's some more examples of whats possible. The below skills are randomly scrambled, but that might give you an idea of what can be done.

  - command{c="execute at <mob.uuid> run minecraft:scoreboard players set @a[x=-16,y=104,z=-60,dx=-3,dy=3,dz=9] mrjlmmw1b 0"}
  - command{c="execute at <mob.uuid> run minecraft:scoreboard players set @a[x=-16,y=104,z=-60,dx=-3,dy=3,dz=9] mrjlmmw1b 1 <&lc>Inventory:[<&lc>id:minecraft:paper,tag:<&lc>display:<&lc>Lore:[0:,1:&7Can be used once for any,2:&7monorail on Jaygrounds.,3:&8Absolutely no refunds.,4:],Name:&fMonorail Ticket&r<&rc><&rc>,Damage:0s<&rc>]<&rc>"}
  - command{c="execute at <mob.uuid> run minecraft:scoreboard players set @a[x=-16,y=104,z=-60,dx=-3,dy=3,dz=9,score_donators_min=1] mrjlmmw1b 2"}
  - command{c="execute at <target.uuid> run minecraft:tp @a[team=!pve_ruins_1,r=50] 366.5 71 487.5 0 0"}
  - command{c="execute at <target.uuid> run minecraft:team join pve_ruins_1 @a[r=50]"}
  - command{c="execute at <target.uuid> run minecraft:scoreboard objectives remove pve_ruins_cur"}
  - command{c="execute at <target.uuid> run minecraft:team remove pve_ruins_3"}
  - command{c="execute at <target.uuid> run minecraft:fill 368 71 494 364 72 494 minecraft:acacia_fence replace minecraft:air"}
  - command{c="execute at <target.uuid> run mm m s pve_ruins_sign_arena_ready 1 world,366.5,71,493.5"}

Tutorial created by jaylawl, 19.01.16

Cleaned up and updated for 1.13 by Rickyling, 25.01.19

tutorials/commandskills.txt · Last modified: 2020/06/30 21:13 (external edit)