Minecraft Blogs / Article

Advanced Command Tutorial

  • 3,312 views, 1 today
  • 3
  • 1
  • 2
MrCatSquid's Avatar MrCatSquid
Level 21 : Expert Fish
12
Hey y'all! I've got a tutorial I wanted to show you guys. Most redstone tutorials are super basic, so this one is a tad more advanced. If you don't already have basic knowledge of commands, I suggest you go check out a easier tutorial first.

Let's start with selectors.
There are 5 selectors:
@a
@e
@r
@p
(The Player's Name)

All of these are pretty much the same, except they can be narrowed down to something more specific. For example: @e[type=Pig,r=5]
What this does, is test for a pig ([type=Pig]) in a radius of 5 blocks ([r=5). 

But what if you want to test for the closest player in a radius of 5 blocks? you just change @e to @p

Now lets say you want a player in survivial only, then you add M. Example: @ptype=Player,r=5,m=0]
This tests for a player (type=Player) in a radius of 5 blocks, in survival (m=0)  

If you want to select every entity except one, add an ! before the name

Now lets say, your player, in survival, has a certain level in a scoreboard you want to test for. you simply add score_NameOfScoreboard_min=minimum score level, and to test for the maximum, you add score_NameOfScoreboard_max=maximum score level.


Now that you have the selectors down, lets move on to replaceitem. This will be short because replaceitem isnt too complicated.

This command is great for adding hats onto your player that you couldn't do without plugins. this command can replace items in any slot in a donkeys saddle chest or to the head slot on a player. To figure this one out, you'll need to experiment yourself. Here is an example to get you started: /replaceitem entity @p slot.armor.head stained_glass 1 2
This will replace the head slot on your player with magenta stained glass. 

The last thing I am going to go over is /execute. This command is SUPER simple.
Execute in a nutshell, binds a entity to a command. First thing you need to do, is add the selector. /execute @e[type=Player] ~ ~ ~
Now that you've selected your entity, you want to bind a command to it. /execute @e[type=Player] ~ ~ ~ /(any command here) ~ ~ ~
Here is a better example: /execute @e[type=Player] ~ ~ ~ /summon Pig ~ ~ ~
This will summon a pig everytime it is activated.

Here are some finished commands you can play around with
hook this one up to clock: /execute @e[type=Snowball] ~ ~ ~ /summon LightningBolt ~ ~ ~
enter this once and every entity will have a glass block on their head: /replaceitem entity @e slot.armor.head stained_glass 1 3
do these in sequence: /scoreboard objectives add Names dummy
/scoreboard teams add Names Name 
/scoreboard teams option Name color gold
/scoreboard teams join Name (yourname)
kills all except player /kill @e[type=!Player]


Please subscribe and leave a diamond, I'm new to PMC and can't wait to put out more tutorials for you guys!
Tags

Create an account or sign in to comment.

1
05/14/2015 2:42 pm
Level 60 : High Grandmaster Meme
Faz_
Faz_'s Avatar
For most of my entity mobs I use This command generator
1
05/14/2015 6:40 pm
Level 21 : Expert Fish
MrCatSquid
MrCatSquid's Avatar
I use that one too, I just forgot to list it XD
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome