This is a collaboration put together by the community and myself, to help you learn about how command blocks work. This topic contains designs that you'd be able to use with your custom maps, from mini-games to full blown, large scale adventure maps.
Thread was taken from my previous topic (now locked), and I thought I would add more to this, as it seemed to help a number of people. Please, feel free to suggest things and please point out where I could fix anything up. All contributors will be given credits.
Also, the forum seems to have issues editing with large amounts of formatting, so if there are any formatting errors, point them out and I'll see what I can do to fix them.
NOTE: In some cases, you may want to do some altering of the designs shown here. Not everyone wants the player to hit a button or walk over a pressure plate. Scroll to the bottom of this post and head over to the Minecraft Wiki to find out more!
List of commands for use on the Command Block: /testfor [datatag] ~ Tests for the specified criteria. /clear ~ Is used to clear a players inventory, or to remove ALL of one item. /difficulty ~ Changes the difficulty to that of which is specified after the initial command. /effect ~ Adds an certain effect to a player for a specified amount of time. /enchant ~ Enchants the item the player/s is/are currently holding. /gamemode ~ Changes the player/s to the specified gamemode. /gamerule ~ Changes the gamerule specified to either true or false. /give ~ Gives a player/s a certain item. /say ~ Broadcasts the message displayed in the Command Block. Player arguements (@a,@p,@r) can beused to display a name in the broadcast. /scoreboard ~ Uses arguements from the Scoreboard. /spawnpoint ~ Sets the spawnpoint at the current location. If followed by X Y Z coordinates, this will set the player/s at a certain block. /time ~ Argument "set" (/time set) number | day | night> . /toggledownfall ~ Toggles rain/snow. /tp @# x y z~ Teleports specified player/s to a set of X Y Z coordinates. /weather [seconds] ~ Used to change the weather, and set it's duration. /xp amount> playername] ~ Gives the player/s a specified number of Experience Orbs. /xp amount>L playername] ~ Gives the player/s a specified number of Experience Levels. /playsound [x] [y] [z] [volume] [pitch] [minimum_volume] ~ Plays a specific sound according to the arguments set. /summon [x] [y] [z] [dataTag] ~ Summons an entity specific to the variables displayed. /blockdata [datatag] ~ Modifies the selected block. /clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode] [mode2] [TileName] ~ Copies all blocks in the selected area. /entitydata <entity> <dataTag> ~ Modifies the selected entity. /fill [dataValue] [oldBlockHandling] [dataTag] ~ Fills the selected area with a block of your choosing. /particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [mode] ~ Creates particle effects, such as those from a splash potion. /replaceitem block <x> <y> <z> <slot> <item> [amount] [data] [dataTag] ~ Replaces the items in block inventories (chests, furnaces) or players and mobs. /setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag] ~ Changes the selected block into another block. /tellraw <player> <raw json message> ~ A formatted message sent to specified players. /testforblock <x> <y> <z> <TileName> [dataValue] [dataTag] ~ Checks if a certain block is in the specified location.
Command Basics:
Targeting:@p = Closest Player@a = All Players@r = Random Player @e = Entity Game Rules:
doDaylightCycle - Stops/Starts the day/night cycle.
commandBlockOutput - Enables/disables text output of command block commands to console.
doFireTick - Enables/disables fire spread.
doMobLoot - Enables/disables mob drops.
doMobSpawning - Enables/disables the spawning of mobs unless you want them to ex: eggs and mob spawners will still spawn mobs.
keepInventory - Enables/disables keeping inventory on death.
mobGriefing - Enables/disables creepers, ghasts, and Wither blowing up blocks, endermen picking up blocksand zombies breaking doors.
naturalRegeneration - Allows/Disallows player to naturally regenerate health (if their hunger bar is high enough)
sendCommandFeedback - Enables/Disables players commands showing up in chat.
showDeathMessages - Whether a message appears in chat when a player dies
Type /gamerule to change the selected game rule.
Scoreboard Display Slots:list - Lists the players killcount in the (TAB) menu.sidebar - Shows the players killcount on a scoreboard on the right side of the screen.belowname - Lists the players killcount below their name label.
Scoreboard Criteria:dummy - Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, and currencies.deathCount - Counts the number of times a player has died.playerKillCount - Counts how many PLAYER kills a player has obtained.totalKillCount - Counts the TOTAL (players and mobs) number of kills a player has obtained.health - Counts how much health a player has left.
Scoreboard Command Block Arguments:score_NAME=# - Maximum experience level for the playerscore_NAME_min=# - Minimum experience level for the player
Targeting Arguments:x=# - X-coordinate y=# - Y-coordinatez=#- Z-coordinater=# - Maximum search radiusrm=# - Minimum search radiusc=# - Number of players. If negative, uses players from the end of the list first. When outputting through a comparator, the signal strength is equal to the number of players it locatesteam=? - Targets players in that specific teamm=# - Targets players in that specific gamemodename=? - Checks for players with this name. Inserting an '!' before the name checks only for players who do not have this name
Example: /tp @p[r=10,team=Black,m=2] 23 64 53This would cause the CLOSEST PLAYER (@p) on the BLACK TEAM (team=Black), within a 10 BLOCK RADIUS (r=10),and the ADVENTURE GAMEMODE (m=2) to be TELEPORTED (tp) to the coordinates 23 64 53.
In another situation:/tp @a[x=23,y=64,z=53,r=20,m=1,team=Black] 32 98 13 In this case, ALL PLAYERS (@a) on the BLACK TEAM (team=Black) within a 20 BLOCK RADIUS (r=20) of the coordinates 23 64 53 and in the GAMEMODE CREATIVE (m=1) would be TELEPORTED (tp) to the coordinates 32 98 13.
Other:l=# - Maximum number of experience levels for the playerlm=# - Minimum number of experience levels for the player
Broadcasting Messages:
World Messages
Command Block: /say Hello World!
Broadcasts a world-wide message.
Player Messages
Command Block: /tell @p Hello Player!
Sends the CLOSEST PLAYER (@p) a message.
Spawnpoint:
Using /spawnpoint makes a wide-based spawn.Instead, use the command /spawnpoint x y z and it will pinpoint the spawn. If this doesn't work, run it through a command block on a loop. This is used for individual players, per world. You can add player variables in this manner: /spawnpoint @a x y z.
Giving Items:
Command Block: /give @p 267This will give the CLOSEST(@p) player an IRON SWORD (267).
NOTE:Item ID and player variable will change based on your map.
FlazeOfAges In-depth Tutorial:
For many versions mapmakers had to use dispensers and large amounts of redstone wiring to give a player equipment. Minecraft 1.4.2 changed everything.
/give works on a few basic arguments: Who you give the item to, what the item is, how many of the item to give, what damage value the item has and further datatags. Like this:/give <ID> [quantity] [damage value] [dataTag]
Let's start simple:/give @p minecraft:stone 1 0This will give the closest player one stone block. You don't have to target the closest player, @a will give ALL players one stone, @r will give a RANDOM player one stone. The next bit says "minecraft:stone" since a recent update you no longer have to use the numerical id's for items/blocks and it has been stated that numerical id's will not be supported in the future. For a list of items and their values, go HERE. Following that is the item count, you can make this number as large as you like. After the count is the damage value, some items aren't affected by damage values while others depend on it. Here's another /give example./give @p minecraft:potion 64 16428This command will give you a stack of "Splash potion of Harming". Potions are one of the most common items to be associated with damage values. For a more in-depth tutorial on custom potions, go HERE.
Following the damage value is where mapmakers/redstoners shine, data tags. I won't go into those too much other than give an example of what you can do with them./give @p 279 1 0 {display:{Name:Destroyer,Lore:I am Tank! Conqueror of Worlds]},ench:id:16,lvl:2},{id:17,lvl:5},{id:18,lvl:5},{id:34,lvl:10}],AttributeModifiers:Operation:0,UUIDLeast:1,UUIDMost:1,Amount:1.0,AttributeName:generic.movementSpeed,Name:whee}]}
Giving Potions:
Command: /give @p 373 1 8259This will give the CLOSEST PLAYER (@p) one POTION OF FIRE RESISTANCE (8259) lasting 8 minutes. The Potion ID is 373, but the Potion DV is always different.As you can see, the ID comes first, then the quantity, then the DV.
The player MUST be holding the item they are going to enchant. This means selecting the first FREE slot on their equipment bar.Command Block One: /give @p 267Gives the NEAREST PLAYER (@p) an IRON SWORD (267).Command Block Two: /enchant @p 16 2Enchants the item the nearest player is holding. In this case, it would give a sword Sharpness II enchantment.
To toggle the weather, use the following command.Command: /weather <clear | thunder | rain> [duration]
Teleportation To Set Coordinates:
Command Block: /tp @p x y z
The variables coloured in Purple are the coordinates, and will be different for everyone.
Relative Teleportation:
This command teleports you a number of blocks away from your current location.Command Block: /tp @p ~x ~y ~zThe variables coloured in Purple indicate how far the player will travel along each axis.
Example: Command Block: /tp @p ~5 ~10 ~15This command will TELEPORT (tp) the CLOSEST PLAYER (@p) 5 block along the X axis (sideways), 10 blocks along the Y axis (up/down) and 15 blocks along the Z axis (sideways).
Experience Shops:
You can change the item by using a different Item ID. Google search it.
Lower Command Block: /give @p[lm=5] 267This will give the nearest player an IRON SWORD (267) for a MINIMUM (lm) of 5 EXPERIENCE LEVELS (=5)Upper Command Block: /xp -5L @p[lm=5]This will SUBTRACT5 EXPERIENCE LEVELS (-5L) from the nearest player, if that player has a MINIMUM (lm) of 5 EXPERIENCE LEVELS(=5).
When giving potions, you must use the command like this:Command Block: /give @p[lm=5] 373 3 16373This would give the CLOSEST PLAYER (@p)3 (3) POTIONS (373) of INSTANT HEALTH (16373).The Potion ID comes first, then the amount, then the Potion value.
Scoreboard:
This can be done as a regular command, but is extremely useful in custom maps.
Type /scoreboard objectives add Points totalKillCount PointsNext, type /scoreboard objectives setdisplay sidebar Points
Note: "Points" can be whatever you wish it to be, just make sure it is the same in both commands.
Now, when you kill something, or someone, your kill count will show on a sidebar to the right side of the screen.The argument "sidebar" can be changed to any of the following:
list - Lists the players killcount in the (TAB) menu.sidebar - Shows the players killcount on a scoreboard on the right side of the screen.belowname - Lists the players killcount below their name label.
The argument "totalKillCount" can be changed to any of the following, depending on your purposes:
dummy - Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, and currencies.deathCount - Counts the number of times a player has died.playerKillCount - Counts how many PLAYER kills a player has obtained.totalKillCount - Count the TOTAL number of kills a player has obtained.health - Counts how much health a player has left. trigger - Score is only changed by commands, and not by game events such as death. The /trigger command can be used by a player to set or increment/decrement their own score in an objective with this criteria. The /trigger command will fail if the objective has not been "enabled" for the player using it, and the objective will be disabled for the player after they use the /trigger command on it. Note that the /trigger command can be used by ordinary players even if Cheats are off and they are not an Operator. This is useful for player input via /tellraw interfaces.
Lower Command Block Command: /scoreboard players remove @p[Points_min=5] Points 5This will SUBTRACT 5 POINTS (remove Points 5) from the CLOSEST PLAYER(@p) if the player has a MINIMUM (score_Points_min) of 5 Points.Upper Command Block Command: /give @p[Points_min=5] 267This will give the CLOSEST PLAYER (@p) an IRON SWORD (267) if the player has a MINIMUM (score_Points_min) of 5 Points.
Having NPCs speak accordingly - Gender:
Giving your character a gender.
STEP ONE:STEP TWO:
"Buyable" Doors:
This is an updated version of the previous "Buyable Doors", and is much easier and clearer to understand.
This is a system that runs of experience levels, but if you wish to use mob kills, just make sure to change the lm argument to the score argument. I'll run through all that needs to be done to achieve this. We will make it cost 10xp and 10 kills to open the door.
If using kills, type this in chat: /scoreboard objectives add Kills totalKillCount Kills You can display this anywhere, but I suggest the sidebar: /scoreboard objectives setdisplay sidebar Kills
Let's build it.
Top Command Block: /tellraw @p[r=8,l=9] {text:"You don't have enough money to open the door!",bold:true,color:red} If using kills, change l=9 to score_Kills=9. Bottom Command Block: /testfor @p[r=8,lm=10] If using Kills, change lm=10 to score_Kills_min=10
Command Block: /xp -10L @p[r=8,lm=10] If using kills: /scoreboard players remove @p[r=8,score_Kills_min=10] Kills 10
Before we keep going, we need some coordinates. Build up the rest of your door:
And get the coordinates from two blocks below. You'll need coordinates from both sides.
1) /tellraw @a {text:"The door is open!",bold:true,color:green} 2) /setblock 0 0 0 redstone_torch (coordinates "0 0 0" are the ones we just took from below the door) 3) /setblock 0 0 0 redstone_torch (coordinates "0 0 0" are the ones we just took from below the door) 4) /fill 0 0 0 0 0 0 air (these coordinates are where our button and sign are. Why remove them, you ask? Well, if the button is pushed again, it can remove more points, and it can be annoying if it just sits there. Removing the button and sign prevents these problems)
And we're done! The results:
Week Counter:
Step one:/scoreboard objectives add week dummy Week /scoreboard objectives add showweek dummy Week /scoreboard objectives setdisplay sidebar showweekStep Two:Build this:And now you have a working setup to count and display a week, which can easily be adjusted for shorter/longer spans of time.Possible uses:(All using a testfor command block somewhere)
Wire to redstone lamps around a spawner to make rare, specific day spawns
Have shops that are only open on certain days of the week
Hook up noteblocks for Sunday church chimes
Use as part of a countdown for time-limited maps
Make some kind of Groundhog Day/Majora's Mask scenario
If you count weeks, you could even set up Minecraft months and years!
Bank System:
I have remade the experience bank for optimization, aesthetics and simplicity. It is now much more compact and is much easier to understand. Here we go.
Get the coordinates of both end blocks for where the gates will be and write them down.
Now let's add the commands. You can tell which command goes where by seeing the blocks position in the background and from earlier images:
These command blocks are done. Set the clock going and let's move onto the next part.
Have a button on the other side of the block from the repeater. Deposit Side: 1) /tellraw @p[lm=10,r=8] {text:"Money Deposited",bold:true,color:gold} 2) /tellraw @p[l=9,r=8] {text:"You don't have enough money to deposit!"bold:true,color:red} 3) /scoreboard players add @p[lm=10,r=8] Money 10 4) /xp -10L @p[lm=10,r=8]
Withdraw Side: 1) /tellraw @p[score_Money_min=5,r=8] {text:"Money Withdrawn",bold:true,color:gold} 2) /tellraw @p[score_Money=0] {text:"You have no money to withdraw!",bold:true,color:red} 3) /scoreboard players remove @p[score_Money_min=10,r=8] Money 10 4) /xp 10L @p[score_Money_min=10,r=8]
The last thing we need to do is give the player a way to exit the bank. Easy. Set this up: Command Block: /tp @p 0 0 0 (where 0 0 0 = coordinates of bank lobby)
Enjoy banking with this new system!
"Rounds" System:
Firstly, you want to run the following commandsin order: 1. /scoreboard objectives add Rounds dummy Rounds Survived 2. /scoreboard objectives add Survivors dummy Survivors 3. /scoreboard objectives setdisplay sidebar Rounds Droppers: First level of droppers - this comparator MUST be in subtraction mode. All others can be normal. Command Block: /scoreboard players add Survivors Rounds 1 This redstone torch stops the system. Put an item in the hopper and the system will begin!
The "Mystery Box":
A concept based around a feature in the Call of Duty franchise.
Preliminary: Run these commands in order: Command One: /scoreboard objectives add Money totalKillCount Money Command Two: /scoreboard objectives setdisplay sidebar Money
Let's get building.
Sticky Piston:
Command Block: /blockdata ~ ~ ~ {SuccessCount:1}
Sticky Piston:
Build a platform:
1) /scoreboard players remove @p[score_Money_min=40,r=12] Money 40 2) /tellraw @p[score_Money=39,r=12] {text:"You don't have enough money to use the box!",bold:true,color:red} 3) /tellraw @p[r=12] {text:"Selecting Weapon..",bold:true,color:gold}
Command Block: /tellraw @p {text:"Make good use of this weapon!",bold:true,color:green}
Dropper, block above it, then chest on ground level.
Chest full of your chosen random items, with hoppers transferring them to the dropper. (Be sure to shuffle the items around a bit in the chest to make it random)
That's done. If you want to link it up to a randomized system of your own, then simply connect it to this part of our system:
Whereas [] are optional, locate the sounds at .minecraft\assets\sound\, and name them after the location within the sound folder; so .minecraft\assets\sound\mob\pig\say will become mob.pig.say - it is IMPORTANT to note that numbers (0-9) CANNOT be used when referring to sound files; instead, the command will cycle through numbered files randomly (e.g. say1, say2, say3 will get picked randomly using the referrer mob.pig.say).
[x] [y] [z] coords are NOT referrers for the player's position, they a the set co-ords for where the sound plays from; for example, setting this to 0 2 3 will play a sound at x0, y2, and z3.
[volume] specifies the volume of the sound played (I think the maximum is 10*)
[Pitch] Specifies the Pitch (e.g. 1 will increase it by one octave, -1 will decrease it; decimals are accepted). I'm not sure, but I think the maximum value might be 6*
[minimum_volume] specify a minimum volume value - I think this means that, if the player is distant from the sound, how quietly it will reach before cutting out (essentially acting as a radius for the sound), but it doesn't appear to work
** Denotes uncertainty, or required confirmation.
Custom Potions:
/give @pThe item id for a potion is 373, so we would use:/give @p 373 1This gives a basic potion (water bottle) with the count of one (that come from the '1' place after '373'). So we now have a water bottle but what if we want it to give some actual effects? To do that we have to add one more number after our count, this number is known as the 'damage' of the potion. Changing the damage of a potion will give different effects, so what happens if we give our water bottle a damage of 1?/give @p 373 1 1See that? We just got a basic Potion of Regeneration. We can use this damage value system to create all kinds of potions. For example, a damage of 2 will give a Potion of Swiftness etc. This is all well and good, but we don't have any "custom" potions yet. We can add custom potion effects by changing the potion's DataTag. This is achieved through the use of 'CustomPotionEffects'. /give @p 373 1 1 {CustomPotionEffects:Id:2,Amplifier:1,Duration:200}]}
Woah, slow down there! Let's break this up:
"CustomPotionEffects:"
CustomPotionEffects is what is telling the command that we want to add custom effect to the potion.
"Id:2" The id is specifying what effect we want. In this case, ID 2 is Slowness. For effect ID's visit the Minecraft Wiki.
"Amplifier:1" The amplifier is enhancing our potion from basic Slowness I. Keep in mind that an amplifier of 0 is considered Slowness I, so an amplifier of 1 gives us Slowness II.
"Duration:200" The duration is telling our potion how long to apply the effect.
IMPORTANT: Duration is measured in ticks (there a 20 ticks per second) so this potion gives a duration of 10 seconds.So when we put everything together, we get a Slowness II potion with a duration of 10 seconds.
That's all well and good, but what if we want multiple effects on our potion? That's simple enough, all we have to do is add another set of data after what we had previously entered.
IMPORTANT: Be sure to separate your effects with a comma, like shown below.
This potion now gives us Slowness II and Nausea for 10 seconds. But we want a more interesting name than "Potion of Slowness", to achieve this we can add a custom name to our potion using the display tag.
IMPORTANT: Be sure to lay this out exactly as below, or it will not work.
{display:{Name:Potion of Lead Feet}}
We can now place our custom name into our our pre-made potion as shown below.
/give 373 1 1 {display:{Name:Potion of Lead Feet},CustomPotionEffects:{Id:2, Amplifier:1,Duration:200},{Id:9,Amplifier:0,Duration:200}]} Voilà! We now have a fully custom potion with a custom name.To learn more about DataTags and how they work, head over to minihilly's post HERE.
Setblock:
Using /setblock: As of 1.7.2, Mojang implemented a feature into mine craft that would forever change the way mapmakers view blocks, /setblock. The setblock command essentially allows a command block (or player) to remotely place blocks into the world. Here's the syntax:
/setblock x y z [data-method] [dataTag]
Start your command with /setblock followed by the coordinates of where the block should be placed. After the coordinates goes the alphabetical ID of the block being placed (NOTE: Future versions of mine craft will not support numerical ID's, so for a full list of alphabetical ID's, go HERE.). Following the block ID is the block data. Most blocks will have a data of 0, but some block (like wool or logs) heavily depend on data values to change their appearance. The method of which the block is placed after the data value. There are three methods available: "keep" summons the block if the space is empty, "replace" will set the specified block no matter what it formally was, and "destroy" will set the block as well as display the particles of the block being destroyed.
Compared to other commands, /setblock doesn't much in the way of data tags, but here are some that are worthy to note: /setblock ~~1 ~minecraft:skull 1 replace {ExtraType:FireArceus64,SkullType:3,Rot:0} The above will set the block above the command block to a skull with my skin on it, you can change the name to make it anyone else's. For a full list of setblock data tags, go HERE.
Ta-Daa! You have now learn't how to use /setblock. As always, here is a command that shows the full extent of /setblock:] /setblock ~~~minecraft:mob_spawner 0 destroy {SpawnCount:1,SpawnRange:13,RequiredPlayerRange:64,Delay:5,MinSpawnDelay:5,MaxSpawnDelay:10,MaxNearbyEntities:50,EntityId:FireworksRocketEntity,SpawnData:{LifeTime:40,FireworksItem:{id:401,Count:1,tag:{Fireworks:{Explosions:[255,16711680,16776960],FadeColors:[255,16711680,16776960]}]}}}}}
How to use setblock for directional placement:
The damage value after the specified block id is what is used to determine which way the block the facing:
Furnace: /setblock ~ ~1 ~ furnace 0 0 = North 3 = South 5 = East 4 = West
Hopper: /setblock ~ ~1 ~ hopper 2 2 = North 3 = South 4 = West 5 = East 6 = Down
Ladder: /setblock ~2 ~ ~ ladder 1 1 = North 3 = South 5 = East 4 = West
NOTE: The ladder cannot be next to a block with updates! This means that it is not possible to place multiple ladders above and below each other.
For the door, you will need to run 2 commands.
Door: /setblock ~-2 ~ ~ wooden_door 0 /setblock ~-2 ~1 ~2 wooden_door 8 Once you run these, there should be a full door. You may need to mess around with the damage values though. Now that you have a full door, you can modify its direction by changing the damage value of the first command.
1 = North 2 = East 3 = South 7 = West
Summon:
Using /summon: Not too long ago, there was a time when mobs had to be summoned from dispensers of custom spawners made with MC-Edit. But that all changed with the addition with /summon in 1.7.2. Let's take a look at some code.
/summon [x y z] [dataTag] This is the syntax for all /summon commands. Start with /summon followed by the name of the entity/mob you want to spawn E.g Pig, Sheep, PrimedTnt; for a full list of entities and their names, go HERE. After the entity's name are the coordinates of the spawn.
Following the coordinates is were some of the more complex command block functions come in; Data Tags. I'll be covering some of the more commonly used tags, but if you want to learn more you can go HERE or HERE.
So let's spawn a basic Pig:
/summon Pig ~ ~1 ~ Following this is where the data tag goes. Let's give the pig a saddle.
/summon Pig ~ ~1 ~ {Saddled:1} See what happened there? It is very important when using tags that you open and close each tag respectively. The Saddle tag is a boolean value, meaning it is either 1 or 0. What happens if we want the pig to have a custom name as well?
/summon Pig ~ ~1 ~ {Saddled:1,CustomName:"Piggy"} NOTE: We do not have to make a new set of brackets for every tag, simply separate each tag with a comma.
So there you go! Now you can use /summon to spawn entities with great ease. Before I finish, here is an example of the kind of things you can do with /summon.
Command: /tellraw <player> <raw json message> An example of one I use: /tellraw @a[score_Health=10] {text:"You're bleeding!",bold:true,color:dark_red}
If any player has 5 health hearts left (2 health points = 1 heart), then a message like this will appear, to only them:
How it works:
/tellraw is just like a regular /tell message, except you are able to format the text in the message; that is, make the text bold, italic,underlined, have a strikethrough, make it coloured, and many, many other types of formatting. The command can be use in conjunction with any of the player selector variables.
Player includes: 1) Username 2) @a 3) @p
List of valid colour values:
black dark_blue dark_green dark_aqua dark_red dark_purple gold gray dark_gray blue green aqua red light_purple yellow white reset
Now for the advanced side of things. We've learned already how to add colour and such to our text, so now we'll take a look at hover and clickEvents, as well as multi-colour.
Let's start simple.
A multi-colour command looks like this:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold}]}
Next, we add a hoverEvent:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,hoverEvent:{action:"show_text",value:"I ate it.."}}]}
Now, let's try that instead with a clickEvent:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,clickEvent:{action:"run_command",value:"/tp @p ~ ~10 ~"}}]}
And everything together:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,clickEvent:{action:"run_command",value:"/give @p cooked_porkchop 1 0 {display:{Name:BACON!}}"},hoverEvent:{action:"show_text",value:"HERE!"}}]}
And that's how it's done! When it's broken down into parts, it is extraordinarily simple.
More about the /tellraw command (via Minecraft Wiki):
<x> <y> <z> The coordinates of the block you are testing.
<blockname> The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
[dataValue] The blockdata to test for. For example, a stone pressure plate has a dataValue of 0, and an activated stone pressure plate has a dataValue of 1.
[dataTag] Tests for block dataTags. (for example, {CustomName:Trophy}). If not specified, the dataTag will process any block dataTag.
<entity> Selects either the person, mob or other entity where you wish to execute the chosen command.
<x> <y> <z> Specifies the position from where to run the command. You can use relative position/tilde notation to make it a certain distance from the player.
<command> The command you have chosen to run.
Eg. /execute @a ~ ~ ~ particle reddust ~ ~1 ~ 0 0 0 0 100 This will play 100 redstone dust particles at 1 block above the players head.
------------------------------------------------------------------------------------------------- Another version of the command allows the command to be executed only if a specific block is detected:
<x2> <y2> <z2> The position of the block to check.
<block> The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
<data> The blockdata to test for. For example, a stone pressure plate has a dataValue of 0, and an activated stone pressure plate has a dataValue of 1.
Eg. /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:cobblestone 0 effect @p 11 25 3 true If there is a block of cobblestone 1 block beneath all players, they will have Resistance 3 for 25 seconds. Particles will be hidden.
With some commands, it can only be played at a set of coordinates, and not a player. /execute can help with this, and here is a way to play the command /particle at the players position.
Giving yourself an aura!
Build:
And in the command block, type: /execute @a ~ ~ ~ particle happyVillager ~ ~ ~ 1 1 1 0 50
The outcome:
With the second /execute variation, we can play a sound to a player when they are standing on a certain type of block. Let's build it!
How it works: The whole idea of this command is to select a region of blocks, copy them, and place them somewhere else in the world.
Parameters:
<x1> <y1> <z1> <x2> <y2> <z2> These coordinates are the two corners of the area you wish to clone.
<x> <y> <z> These are the coordinates of where you wish to paste the copied area. The coordinates will be the lower northwest corner of the region you have selected. Relative position / tilde notation can be used.
[mode] There are 3 different modes to choose from:
1) filtered - Only clones blocks with a certain ID (see blockname below) 2) masked - Copies all blocks except air. Any blocks that are air will be left untouched. 3) replace - copies all blocks and replaces them with the ones that the selected destination. If not selected, it will automatically be replace.
[mode2] There are 3 different modes to choose from:
1) force - Forces the cloning to work, even if the selected region and the destination overlaps. 2) move - Removes the selected blocks and pastes them at the destination. 3) normal - Doesn't move or force. Used when blockname is being specified. If not selected, defaults to normal.
[block] The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
<x> <y> <z> This only works for block mode. It is the coordinates of the block to be modified.
<selector> Selects the player of entity to modify. It must be a player name or target selector.
<slot> Specifies the inventory slot to be modified.
For blocks: slot.container.slot_number where slot_number is replaced with a number specifying the slot. Notes for <slot> usage on blocks :
Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
A brewing stand's bottom slots are numbered 0 to 2 from left to right, and its top slot is 3.
A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can only be changed with /blockdata.
For entities, must be one of the following, where slot_number is replaced with a number specifying the slot: Notes for <slot> usage on entities:
Slots:
slot.armor.chest slot.armor.feet slot.armor.head slot.armor.legs -= armor stands, mobs, and players only (though not all mobs will show or make use of the items) slot.weapon -= armor stands and mobs only (though not all mobs will show or make use of the items) slot.enderchest.slot_number - Numbers 0 - 26 slot.hotbar.slot_number - Numbers 0 - 8 slot.inventory.slot_number - Numbers 0 - 26 -= players only slot.horse.saddle -= horses, donkeys, and mules only; item must be a saddle slot.horse.armor -= horses only; item must be a type of horse armor slot.horse.chest.slot_number -= donkeys and mules with chests only - Numbers 2 - 16 slot.villager.slot_number -= villagers only - Numbers 0 - 7
<item> Specifies the item to be placed in a block of in the inventory of an entity.
[amount] The amount of the chosen item. Must be between 1 and 64.
[data] Specifies the item data for the item(s) to be placed in the block or entity's inventory slot.
[dataTag] Specifies the dataTag for the chosen item.
Entity Data:
Command: /entitydata <entity> <dataTag>
<entity> The entity/entities you wish to modify. Must be an entity UUID or the @e target selector. "A UUID (Universal Unique Identifier) is a 128-bit number used to uniquely identify some object or entity on the Internet." ~TechTarget
<dataTag> Specifies the dataTag elements to be added to, or overwrite elements of, the selected entity.
To prevent all current zombies from picking up loot: entitydata @e[type=Zombie] {CanPickUpLoot:0}
-all information from this section gathered from the Minecraft Wiki.
<x> <z> The coordinates of the central location to spread selected players.
<spreadDistance> The minimum distance between targets.
<maxRange> The maximum distance (along the horizontal axis from the center of the area) to spread the targets.
<respectTeams> Specifies whether to keep teams together - must be true or false. If true, all players on the same team will be teleported to the same location.
<player> Specifies the targets to spread. Must be one or more player names and/or target selectors separated by spaces (@e is permitted to target entities other than players).
This command is useful for PVP arena's or cooperative custom maps.
-all information from this section gathered from Minecraft Wiki.
Just like the /tesforblock command, this command tests for blocks.
<x1> <y1> <z1> <x2> <y2> <z2> These are the corners of the area to test for.
<x> <y> <z> Specifies the lower northwestern corner of the area to be tested.
[mode] Specifies how to match blocks. There are two options:
1) all - every block in the source and destination regions must match exactly. 2) masked - air blocks in the source region will match any block in the destination region. If not selected, defaults to all.
Title:
This command has five variants:
1) title <player> clear (removes a screen title from the screen) 2) title <player> reset (resets options to default values) 3) title <player> subtitle <raw json title> (specifies the subtitle text) 4) title <player> times <fadeIn> <stay> <fadeOut> (specifies fade-in, stay, and fade-out times) 5) title <player> title <raw json title> (displays the screen title) How it works: This command displays a line of text (title) to the player in the middle of their screen, and it can include a second line of text (subtitle). Titles can fade in and out, and can stay on the screen for however long is specified. They are displayed at the same size of the GUI Scale, and if they are too long, will continue of the edge of the screen.
Parameters:
<player> The player(s) to show the title to.
<raw json title> This can only be used in title and subtitle modes. It provides formatting for the displayed text. Take a look at the /tellrawsection from earlier.
<fadeIn> <stay> <fadeOut> Specifies the in-game ticks (20 game ticks = 1 second)
How it works: This command is used with /tellraw to let players operate systems made by mapmakers.The objective must be an enabled scoreboard objective of the criteria "trigger". The given value is either added to its existing value, or becomes its new value, depending on whether the second argument is add or set. The value of the objective is only changed for the player who uses the command.
See the scoreboards section for more information! Here is a worked tutorial on how to use the tellraw /trigger command.
I made it so that once all 4 pieces of TNT are placed, it automatically resets and players are teleported out to spawn. You could easily make teams, and for each piece of TNT placed add 1 point on the scoreboard. This could result in announcing the winning team and such.
Now, if you want to make mini-games or PVP arenas, this would make an awesome gamemode! Just add some touches of your own and it'll be good to go.
achievement.achievement_name - achievement_name must be a valid achievement name. stat.statistic_name - statistic_name must be a valid statistic name. The symbol * can be used to represent all achievements.
[player] Must be a player name or target selector.
To increase the "Mob Kills" statistic by 1 for the nearest player: achievement give stat.mobKills @p
To remove all achievements from all players: achievement take * @a
Difficulty:
Command: /difficulty <new difficulty>
<new difficulty> must be one of the following:
peaceful / p / 0 easy / e / 1 normal / n / 2 hard / h / 3
Hardcore is not an available difficulty, as it is not an option in this command.
Gamemode:
Command: /gamemode <mode> [player]
<mode> must be one of the following:
survival / s / 0 creative / c / 1 adventure / a / 2 spectator / sp / 3
Hardcore is not an available gamemode as it is technically not a gamemode.
[player] If used, must be either a player name or target selector, but if not specified, it will change the gamemode of the player using the command. When using it in a command block, a player MUST be specified.
Kill:
Command: /kill [player | entity]
[player | entity] Specifies the entity to be killed. This can be non-living entities as well. You must use a player name or target selector, and if not specified, it will kill the user. When using it in a command block, an entity MUST be specified. To kill everything, type /kill @e To kill all zombies, type /kill @e[type=Zombie] To kill all pigs in the radius of 20 blocks, type /kill @e[type=Pig,r=20]
A Brief Introduction to Data Tags:
DataTags are NBT tags, which are used to save and store data in Minecraft. The data is shown in a list of pairs, each pair separated by a comma, and each pair has the format of <key>:<value>. The key is the name of the NBT tag, and the value is what data you wish to assign to it. For example: {CustomName:"Frank"} This would cause the entity to have the name Frank above it.
All dataTags open and close with curly brackets: { } DataTags look like this: {display:{Name:Bandage}
That will rename the item to "Bandage"
As well as this, you are able to do a list of tags, so you can ever further customize items and entities:
{display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}}
This will apply two tags to the chosen item, causing it to have the name "Bandage", and have the lore (line under the name) say "Use this to patch yourself up!" Both these tags are listed under the tag-category "display", as they both change the display of the selected item.
You way also be asking why the 'Lore' tag is using square brackets. This is called an 'array'. Each item in an array is separated by commas, so to add more tags to the 'display' tag category, all you need to do is add more commas.
Here is an example of a /give command:
/give @p paper 5 0 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}}
@p = closest player
paper = our given item
5 = 5 of the item
0 = the damage value (this causes the item to be damaged)
And the rest is what we have discussed.
Another tag is the 'ench' tag, to specify enchantments. It is set out like this:
{ench:[{id:62,lvl:3}]}
This would give you Lure, level 3.
Inside the 'ench' tag are two sub-tags; 'id' and 'lvl'.
'id' specifies the enchantment, and 'lvl' specifies the level of the enchantment.
Now we will give a player a fishing rod with Lure, level 3 enchantment on it:
/give @p fishing_rod 1 0 {ench:[{id:62,lvl:3}]}
And to give the player an item with and enchantment and custom name + lore we do:
/give @p fishing_rod 1 0 {display:{Name:Salmon Snatcher,Lore:["A powerful fishing rod!"]},ench:{[id:62,lvl:3]} As you can see, all we need to do is add one comma after the 'display' tag, and we are able to add our enchantment. And this is the outcome:
If you want to add multiple enchantments to an item, it is as simple as this:
ench:{[id:62,lvl:3},{id:61,lvl:3]}
This will not only give us 'Lure' level 3, but it will also give us 'Luck of the Sea' level 3 enchantment. It is as easy as adding another comma and adjusting the position of the final square bracket.
What this is: The bleeding/bandage system is a custom design made by me (Feare), and consists of 5 parts:
1) Scoreboard Values. 2) The bleeding animation. 3) The negative effects. 4) The subtitles. 5) The usage of a bandage.
I will show you how to make this, and explain how it works.
Firstly, before we start building the system, we need our scoreboard to be active. Start with this: /scoreboard objectives add Health health Health
This will make a health counter under the name "Health" Next: /scoreboard objectives setdisplay sidebar Health This will display the amount of health a player has. Note that 2 health = 1 heart. We can now see how total health in a sidebar on the right of the screen:
For the second scoreboard value, we need to type: /scoreboard objectives add Bandage dummy Bandage This is a dummy objective, meaning it can't be altered by anything other than commands. It doesn't need to be displayed as it is only for our mechanics.
For this part, we make use of the /execute and /particle commands.
Here is the layout for our command blocks. You'll need 2 hoppers, 1 comparator and 2 command blocks:
It doesn't matter which command block you put these commands into, just make sure you have them both:
/execute @a[score_Health=10] ~ ~ ~ particle reddust ~1 ~ ~ 0 0 0 0 200 This will execute the command at all players @a with a maximum Health of 10 (5 hearts). It will be along the x-axis 1 block, and be played the redstone dust particle effect, with 200 particles.
/execute @a[score_Health=10] ~ ~ ~ particle reddust ~ ~1 ~ 0 0 0 0 200 This one is exactly the same, except this time it is inside the player, making it seem as though blood is flowing from a wound.
Here is what it looks like:
Here we add negative effects for when the player reaches 8 health, or 4 hearts. This is to make it seem as though they are getting weaker. We will do the negative effects and subtitles together, in order to make it more compact.
First, make a layout like this. You'll need 8 command blocks, 2 comparators and 24 hoppers:
Each hopper connects, making a circuit. Make sure there are 12 on each side.
Now, go to one set of command blocks, and put one command into each block:
And there is our subtitle, showing the player that they're bleeding. We need to put in the /title @a[score_Health=10] title {text:""} , or the subtitle command won't work.
At the other end of the hopper circuit, put these four commands into the other four command blocks:
/effect @a[score_Health=8] 7 10 0 true /effect @a[score_Health=8] 11 1 3 true /title @a[score_Health=10] title {text:""} /title @a[score_Health=10] subtitle {text:"Use a bandage to patch yourself up!",color:green}
The outcome:
The two /effect commands we are using add Instant Damage and Resistance. Instant Damage adds a blood loss effect, and Resistance cuts that damage down to half-a-heart, or 1 damage per hopper circuit.
And our second subtitle.
Time for the final part. When using the bandage, the player needs to have it in their last hotbar slot, and be holding it. We do this so it mimics the actual use of an item.
Firstly, we want to give ourselves the correct item. In chat, type this command:
/give @p paper 5 0 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}} This will give us 5 "Bandages" that we can test our mechanism with.
Now set this up: Command Block: /testfor @a[score_Health=10] {SelectedItemSlot:8,Inventory:[{Slot:8b,tag:{display:{Name:”Bandage”,Lore:[“Use this to patch yourself up!”]}}}]}
Command Block: /scoreboard players add @a[score_Health=10] Bandage 1 Block One: /effect @a[score_Health_min=9] slowness 0 0 This removes slowness from the player.
Block Two: /effect @a[score_Health_min=9] mining_fatigue 0 0 This removes mining fatigue from the player.
Block Three: /clear @a[score_Health=10] paper 0 1 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}} This takes away 1 bandage from the player. Block Four: /say @a[score_Bandage=1] has applied a bandage to their wound! Example:Feare has applied a bandage to their wound!
Block Five: /scoreboard players reset @a Bandage Resets the Bandage dummy score to 0.
Command Block: /effect @a[score_Health=10] instant_health 1 0 Heals the player for 1 second, giving 2 hearts health.
The final image show how to reset the comparator and command block. Take note of nodes.
Make sure all the hopper clocks have 1 item passing around, and then your Bleeding/Bandage system is ready for testing!
Mob Health Bar:
Before we begin, all credit for this mechanic goes to Dragnoz, as he was the one who created this. He is truly spectacular.
First things first. The scoreboard. Type in this command: /scoreboard objectives add healthbar dummy healthbar
Yeah, that's A LOT of command blocks. Let's go through them all.
Okay, now that that is done, we need to wire it up to a clock. What happens here is simple. Basically, there is a redstone block with an activator rail on it. We then put a command block with a minecart on top of the activator rail. This is essentially an extremely fast redstone clock.
The command block on the left runs the command: /setblock ~ ~ ~-1 redstone_block And the command block on the right runs this command: /setblock ~ ~ ~1 air
Now link the clock with the command blocks as shown, and every mob that spawns will have the following healthbar:
Enjoy your new mob health bars, and don't forget to pop by Dragnoz's website to check out other cool things he has created!
Timer:
This tutorial shows you how to make a timer with seconds, minutes and hours. We will be utilizing the scoreboard.
How this works is simple. The first image adds our seconds. In the second image, the clock on the left tests if Seconds has reached 60. If so, it will reset Seconds to 0 and add 1 minute. The clock on the right tests if Minutes has reached 60. If it has, it will reset minutes and add 1 hour.
Deployable Medkit:
With the deployable medkit, you can place down a healing beacon for your teammates to heal at. It has a limited time span, and utilizes spawn eggs for the "deployability."
Before we begin, you'll need to set a scoreboard argument: /scoreboard objectives add BeaconTimer dummy BeaconTimer
This will enable use to make the medkit last only a limited time.
Start by placing down command blocks. The command block on the right is inside a minecart, and can be obtained by using /give @p command_block_minecart It is on top of an activator rail on a redstone block.
Depending on placement, you'll need to change the relative coordinates, but it is as follows:
Left side: /setblock ~1 ~ ~ air
Right side: /setblock ~-1 ~ ~ redstone_block
Next, we need to link it up to a warning message. It tells us that the beacon will soon disappear.
Bottom: /scoreboard players test BeaconTimer BeaconTimer 60 60
Top: /tellraw @a ["",{"text":"HealthBeacon is about to expire!","color":"red"}]
Next we need to setup the disappearing part of the beacon, and the actual healing mechanism.
Upper Command Block: /scoreboard players test BeaconTimer BeaconTimer 100 100
Now, in order to aware people that the beacon has vanished, and to reset the system, we need 3 command blocks. Top: /tellraw @p ["",{"text":"HealthBeacon has expired!","color":"dark_red"}]
Middle: /scoreboard players set BeaconTimer BeaconTimer 0
Bottom: /kill @e[type=Item,name=HealthBeacon]
That's the first part done. The next part is setting up the Silverfish and Beacon spawning mechanism.
First, setup the mechanism the same way as last time:
Afterwards, we need to do this. One block makes the Silverfish invisible, and the other tests for a Silverfish. Attach a comparator to the "testfor" block. Top: /effect @e[type=Silverfish] invisibility 9999 2 true Bottom: /testfor @e[type=Silverfish] When the beacon spawns, we'll need to teleport it to the location of the Silverfish. Let's attach it to the main mechanism: Above Mechanism: /tp @e[type=Item,name=HealthBeacon] @e[type=Silverfish] The next section makes a clean beacon spawn, without any bugs or duplicates: Top: /summon Item ~ ~50 ~1 {CustomName:"HealthBeacon",CustomNameVisible:1,Item:{id:beacon,Count:1},Age:-32768,PickupDelay:32767} Bottom: /kill @e[type=Item,name=HealthBeacon] Left: /scoreboard players set BeaconTimer BeaconTimer 0
Also have a hole behind these blocks for any extra entities to fall through to the void:
Now we attach a comparator and add in a few basic commands: Top: /blockdata ~2 ~-1 ~ {SuccessCount:0} Middle: /kill @e[type=Silverfish] Bottom: /tellraw @a ["",{"text":"HealthBeacon deployed!","color":"dark_green"}]
Now, for the final section we use a different clock. It's a bit slower, and makes it easier to detect change. This part is easy. It is simply the timer for the Health Beacon. Left: /testfor @e[type=Item,name=HealthBeacon] Bottom: /scoreboard players add BeaconTimer BeaconTimer 1 Top: /blockdata ~ ~-1 ~-2 {SuccessCount:0}
AND FINALLY... Give yourself a deployable medkit! /give @p minecraft:spawn_egg 2 60 {display:{Name:Health Beacon,Lore:[Place this down for your teammates, so they can heal!]}}
Enjoy this wonderful new mechanism!
Laser-Tracking Turrets:
These turrets lock on with lasers and shoot you! Get behind them and shut them down! Using the Guardians lock-on ability and a pig with no AI, you can easily make a stationary turret.
I am a terrible builder, but build a turret and set it up like so (the dispenser can remain empty): Have your command blocks set up like this. Of course, you can move them underground and things like that, just be sure to change the coordinates. The exclamation mark is simply to show players that the turret is still online and working. Detection distance can be changed by altering {Name:generic.followRange,Base:30} - currently, this causes the turret to shoot at players 30 blocks away, and within sight. Damage dealt can also be altered by changing {Name:generic.attackDamage,Base:10} - this currently does 5 hearts of damage. Top: /summon Guardian ~ ~1 ~ {CustomName:"HellfireTurret",CustomNameVisible:1,Attributes:[{Name:generic.attackDamage,Base:10},{Name:generic.followRange,Base:30}],Invulnerable:1,PersistenceRequired:1,Silent:1,ActiveEffects:[{Id:14,Amplifier:2,Duration:1999980,ShowParticles:0b}],Riding:{id:"Pig",CustomName:"HellfireTurret",CustomNameVisible:1,Invulnerable:1,PersistenceRequired:1,NoAI:1,Silent:1,ActiveEffects:[{Id:14,Amplifier:2,Duration:1999980,ShowParticles:0b}]}} Bottom: /setblock ~ ~2 ~ minecraft:skull 2 replace {ExtraType:MHF_Exclamation,SkullType:3} The next part is the shutting down of the turret. Very simple. Left: /setblock ~1 ~3 ~-2 air Right: /kill @e[name=HellfireTurret,r=6]
That's all folks! Enjoy tormenting players with these difficult turrets!
Kamikaze Donkey:
Summon a donkey and blow it up with a detonator!
Firstly, let's give ourselves a simple book to summon a horse. Because books don't allow to have a long run_command line, you sometimes need to improvise. That's what we'll do: /give @p minecraft:written_book 1 0 {title:"Kamikaze Mule!",author:"",generation:0,pages:["{text:\"Kamikaze Mule\",color:green,bold:true,hoverEvent:{action:'show_text',value:\"Ride this mule to it's death!\"},clickEvent:{action:'run_command',value:\"/summon EntityHorse ~ ~1 ~ {Type:0,Variant:0}\"}}"]}
Next, let's set up a clock to change some of things on this horse. It'll need a saddle... Left: /setblock ~1 ~ ~ air Right: /setblock ~-1 ~ ~ redstone_block Top: /entitydata @e[type=EntityHorse] {Type:1,SaddleItem:{id:saddle},Tame:1,Attributes:[{Name:generic.maxHealth,Base:10},{Name:horse.jumpStrength,Base:0}]}
Now we have our mule, we'll need a detonator to blow it up with! /give @p minecraft:map 1 0 {display:{Name:Detonator,Lore:[Set off the explosives!]}} And for the mechanics: /clear @a filled_map 1) /effect @p absorption 5 6 Ensure player doesn't die/take too much damage2) /give @a minecraft:map 1 0 {display:{Name:Detonator,Lore:[Set off the explosives!]}} Gives player back the detonator3) /blockdata ~ ~-1 ~-2 {SuccessCount:0} Resets command block4) /execute @e[type=EntityHorse] ~ ~ ~ summon Creeper ~ ~ ~ {ignited:1,ExplosionRadius:3,Fuse:0,NoAI:1} Summons Creeper that explodes instantly at mules location (upon use of detonator)
Enjoy this new, itty bitty, explosively fantastic mule!
xFeare_'s Book of Tactics:
An incredibly overpowered book full of buffs, debuffs and attacks!
There is no tutorial. Just take this command and enjoy! Some mechanisms will NOT work due to them needing to be built using command blocks. This only refers to attacks. All buffs and debuffs should work fine.
The command:
/give @p minecraft:written_book 1 0 {display:{Name:Book of Tactics,Lore:[Enhance your teams' ability!]},title:"Book of Tactics",author:"Officer xFeare_",generation:3,pages:["{text:\"Book of Tactics\",color:gold,bold:true,underlined:true,extra:[{text:\" \",color:dark_red,bold:false,underlined:false},{text:\" Goto > Attacks\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Attacks Page\"},clickEvent:{action:'change_page',value:\"2\"}},{text:\" Goto > Buffs\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Buffs Page\"},clickEvent:{action:'change_page',value:\"3\"}},{text:\" Goto > Debuffs\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Debuffs Page\"},clickEvent:{action:'change_page',value:\"4\"}}]}","{text:\"Attacks\",color:gold,bold:true,underlined:true,extra:[{text:\" Fireball\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Summon Fireball\"},clickEvent:{action:'run_command',value:\"/summon Fireball ~ ~1 ~ {Motion:[0.0,0.0,0.0],direction:[0.0,0.0,0.0],ExplosionPower:1}\"}},{text:\" Summon Earth Golem\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Summon Friendly Golem\"},clickEvent:{action:'run_command',value:\"/summon VillagerGolem ~1 ~1 ~ {Attributes:[{Name:generic.attackDamage,Base:4}],HealF:10}\"}},{text:\"Explosions\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Create an Explosion\"},clickEvent:{action:'run_command',value:\"/summon Creeper ~ ~ ~ {ignited:1,ExplosionRadius:3,Fuse:0,NoAI:1}\"}},{text:\" Kamikaze Mule\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Ride this mule to it's death!\"},clickEvent:{action:'run_command',value:\"/summon EntityHorse ~ ~1 ~ {Type:0,Variant:0}\"}}]}","{text:\"Buffs\",color:gold,bold:true,underlined:true,extra:[{text:\" Strength of the Lion (Self-Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Personal Strength Increase\"},clickEvent:{action:'run_command',value:\"/effect @p strength 60 2\"}},{text:\" Lion's Roar (Party Buff) \",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Party Strength Increase\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] strength 30\"}},{text:\" Eye's of the Owl (Party Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Party Nightvision\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] night_vision 30\"}},{text:\" Lizard's Regeneration (Self-Heal)\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Personal Health Increase\"},clickEvent:{action:'run_command',value:\"/effect @p instant_health 1 1\"}},{text:\" Cheetah's Speed (Party Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Increase Party Speed\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] speed 15 2\"}},{text:\" Resilience (Self-Buff)\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Boost Personal Damage Intake\"},clickEvent:{action:'run_command',value:\"/effect @p absorption 15 4\"}},{text:\"Vanish (Self-Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Sneak Behind the Enemy\"},clickEvent:{action:'run_command',value:\"/effect @p invisibility 20 2\"}}]}","{text:\"Debuffs\",color:gold,bold:true,underlined:true,extra:[{text:\" Cripple\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Cripple Your Foes\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie] slowness 15 \"}},{text:\" Intimidate\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Weaken Your Foes\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie] weakness 15\"}},{text:\" Poison\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Poison Your Enemies\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie,r=5] wither 10\"}}]}"]}
Thank you. I'm going to work on adding more map-based mechanics, and give worked examples of the newer commands such as /trigger and /tellraw. I also plan on creating updated tutorials for the "Buyable" Doors and Experience Bank sections. They could do with a lot of optimization!
Good job Feare
Feare To Your Bleeding Tut Is their a way to make the command stop spamming my chat whenever somebody starts bleeding? Without going to options and then changing your chat options?
Also could you do a tut on mob health bar? thank you
Good job Feare
Feare To Your Bleeding Tut Is their a way to make the command stop spamming my chat whenever somebody starts bleeding? Without going to options and then changing your chat options?
Also could you do a tut on mob health bar? thank you
If the command block is spamming in chat, all you have to do is type /gamerule commandBlockOutput false. This will stop command blocks broadcasting their commands.
And for some reason, whenever I click backspace or delete, all the formatting mucks about. I've gone through every individual section and should have fixed most of it up, but if anyone knows what causes the problem, please message me about it! It's starting to get really irritating
Also, feel free to send in anything you've created! I'd love to add it, and as mentioned in the main post, credits will be given to all you contribute!
I need help with something: how do you take an item from a players inventory? I'm working on my friends server kit pvp and I want it so if you chose the wrong kit and want to change it you don't have the old kit's items still. Please help I need it OR show me another place to find out.
and if you can please show me an example.
I need help with something: how do you take an item from a players inventory? I'm working on my friends server kit pvp and I want it so if you chose the wrong kit and want to change it you don't have the old kit's items still. Please help I need it OR show me another place to find out.
and if you can please show me an example.
It's very simple. When someone selects a kit, make a command block that runs the /clear command, and then make a repeater after that block, giving the player the kit. Like this:
I hope that helps. Post again if you need more help =)
Thread updated with worked /tellraw and /trigger tutorial.
[TUTORIAL] Command Blocks
Hey Guys!
This is a collaboration put together by the community and myself, to help you learn about how command blocks work. This topic contains designs that you'd be able to use with your custom maps, from mini-games to full blown, large scale adventure maps.
Thread was taken from my previous topic (now locked), and I thought I would add more to this, as it seemed to help a number of people. Please, feel free to suggest things and please point out where I could fix anything up. All contributors will be given credits.
Also, the forum seems to have issues editing with large amounts of formatting, so if there are any formatting errors, point them out and I'll see what I can do to fix them.
NOTE: In some cases, you may want to do some altering of the designs shown here. Not everyone wants the player to hit a button or walk over a pressure plate. Scroll to the bottom of this post and head over to the Minecraft Wiki to find out more!
---------------------------------------------------------------------------------------------
Contents:
---------------------------------------------------------------------------------------------
Commands:
Command Basics:
doDaylightCycle - Stops/Starts the day/night cycle.
commandBlockOutput - Enables/disables text output of command block commands to console.
doFireTick - Enables/disables fire spread.
doMobLoot - Enables/disables mob drops.
doMobSpawning - Enables/disables the spawning of mobs unless you want them to ex: eggs and mob spawners will still spawn mobs.
doTileDrops - Enables/disables blocks dropping items when broken (includes TNT destroying blocks)
keepInventory - Enables/disables keeping inventory on death.
mobGriefing - Enables/disables creepers, ghasts, and Wither blowing up blocks, endermen picking up blocksand zombies breaking doors.
naturalRegeneration - Allows/Disallows player to naturally regenerate health (if their hunger bar is high enough)
sendCommandFeedback - Enables/Disables players commands showing up in chat.
showDeathMessages - Whether a message appears in chat when a player dies
Type /gamerule to change the selected game rule.
Scoreboard Display Slots: list - Lists the players killcount in the (TAB) menu. sidebar - Shows the players killcount on a scoreboard on the right side of the screen. belowname - Lists the players killcount below their name label.
Scoreboard Criteria: dummy - Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, and currencies. deathCount - Counts the number of times a player has died. playerKillCount - Counts how many PLAYER kills a player has obtained. totalKillCount - Counts the TOTAL (players and mobs) number of kills a player has obtained. health - Counts how much health a player has left.
Scoreboard Command Block Arguments: score_NAME=# - Maximum experience level for the player score_NAME_min=# - Minimum experience level for the player
Targeting Arguments: x=# - X-coordinate y=# - Y-coordinate z=#- Z-coordinate r=# - Maximum search radius rm=# - Minimum search radius c=# - Number of players. If negative, uses players from the end of the list first. When outputting through a comparator, the signal strength is equal to the number of players it locates team=? - Targets players in that specific team m=# - Targets players in that specific gamemode name=? - Checks for players with this name. Inserting an '!' before the name checks only for players who do not have this name
Example: /tp @p[r=10,team=Black,m=2] 23 64 53 This would cause the CLOSEST PLAYER (@p) on the BLACK TEAM (team=Black), within a 10 BLOCK RADIUS (r=10),and the ADVENTURE GAMEMODE (m=2) to be TELEPORTED (tp) to the coordinates 23 64 53.
In another situation: /tp @a[x=23,y=64,z=53,r=20,m=1,team=Black] 32 98 13 In this case, ALL PLAYERS (@a) on the BLACK TEAM (team=Black) within a 20 BLOCK RADIUS (r=20) of the coordinates 23 64 53 and in the GAMEMODE CREATIVE (m=1) would be TELEPORTED (tp) to the coordinates 32 98 13.
Other: l=# - Maximum number of experience levels for the player lm=# - Minimum number of experience levels for the player
Broadcasting Messages:
Command Block: /say Hello World!
Broadcasts a world-wide message.
Player Messages
Command Block: /tell @p Hello Player!
Sends the CLOSEST PLAYER (@p) a message.
Spawnpoint:
Giving Items:
NOTE: Item ID and player variable will change based on your map.
FlazeOfAges In-depth Tutorial:
For many versions mapmakers had to use dispensers and large amounts of redstone wiring to give a player equipment. Minecraft 1.4.2 changed everything.
/give works on a few basic arguments: Who you give the item to, what the item is, how many of the item to give, what damage value the item has and further datatags. Like this: /give <ID> [quantity] [damage value] [dataTag]
Let's start simple: /give @p minecraft:stone 1 0 This will give the closest player one stone block. You don't have to target the closest player, @a will give ALL players one stone, @r will give a RANDOM player one stone. The next bit says "minecraft:stone" since a recent update you no longer have to use the numerical id's for items/blocks and it has been stated that numerical id's will not be supported in the future. For a list of items and their values, go HERE. Following that is the item count, you can make this number as large as you like. After the count is the damage value, some items aren't affected by damage values while others depend on it. Here's another /give example. /give @p minecraft:potion 64 16428 This command will give you a stack of "Splash potion of Harming". Potions are one of the most common items to be associated with damage values. For a more in-depth tutorial on custom potions, go HERE.
Following the damage value is where mapmakers/redstoners shine, data tags. I won't go into those too much other than give an example of what you can do with them. /give @p 279 1 0 {display:{Name:Destroyer,Lore:I am Tank! Conqueror of Worlds]},ench:id:16,lvl:2},{id:17,lvl:5},{id:18,lvl:5},{id:34,lvl:10}],AttributeModifiers:Operation:0,UUIDLeast:1,UUIDMost:1,Amount:1.0,AttributeName:generic.movementSpeed,Name:whee}]}
Giving Potions:
The Potion DV list can be found here on the Minecraft Wiki!
Giving Enchanted Items:
More on Enchantments can be found here on the Minecraft Wiki!
Potion Effects:
More on Potion Effects can be found here on the Minecraft Wiki!
Weather:
Teleportation To Set Coordinates:
The variables coloured in Purple are the coordinates, and will be different for everyone.
Relative Teleportation:
Example: Command Block: /tp @p ~5 ~10 ~15 This command will TELEPORT (tp) the CLOSEST PLAYER (@p) 5 block along the X axis (sideways), 10 blocks along the Y axis (up/down) and 15 blocks along the Z axis (sideways).
Experience Shops:
Lower Command Block: /give @p[lm=5] 267 This will give the nearest player an IRON SWORD (267) for a MINIMUM (lm) of 5 EXPERIENCE LEVELS (=5) Upper Command Block: /xp -5L @p[lm=5] This will SUBTRACT 5 EXPERIENCE LEVELS (-5L) from the nearest player, if that player has a MINIMUM (lm) of 5 EXPERIENCE LEVELS (=5).
When giving potions, you must use the command like this: Command Block: /give @p[lm=5] 373 3 16373 This would give the CLOSEST PLAYER (@p) 3 (3) POTIONS (373) of INSTANT HEALTH (16373). The Potion ID comes first, then the amount, then the Potion value.
Scoreboard:
Type /scoreboard objectives add Points totalKillCount Points Next, type /scoreboard objectives setdisplay sidebar Points
Note: "Points" can be whatever you wish it to be, just make sure it is the same in both commands.
Now, when you kill something, or someone, your kill count will show on a sidebar to the right side of the screen. The argument "sidebar" can be changed to any of the following:
list - Lists the players killcount in the (TAB) menu. sidebar - Shows the players killcount on a scoreboard on the right side of the screen. belowname - Lists the players killcount below their name label.
The argument "totalKillCount" can be changed to any of the following, depending on your purposes:
dummy - Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, and currencies. deathCount - Counts the number of times a player has died. playerKillCount - Counts how many PLAYER kills a player has obtained. totalKillCount - Count the TOTAL number of kills a player has obtained. health - Counts how much health a player has left. trigger - Score is only changed by commands, and not by game events such as death. The /trigger command can be used by a player to set or increment/decrement their own score in an objective with this criteria. The /trigger command will fail if the objective has not been "enabled" for the player using it, and the objective will be disabled for the player after they use the /trigger command on it. Note that the /trigger command can be used by ordinary players even if Cheats are off and they are not an Operator. This is useful for player input via /tellraw interfaces.
-information gathered via Minecraft Wiki.
Point Shops (Using points from the Scoreboard):
Lower Command Block Command: /scoreboard players remove @p[Points_min=5] Points 5 This will SUBTRACT 5 POINTS (remove Points 5) from the CLOSEST PLAYER (@p) if the player has a MINIMUM (score_Points_min) of 5 Points. Upper Command Block Command: /give @p[Points_min=5] 267 This will give the CLOSEST PLAYER (@p) an IRON SWORD (267) if the player has a MINIMUM (score_Points_min) of 5 Points.
Having NPCs speak accordingly - Gender:
STEP ONE:
"Buyable" Doors:
This is a system that runs of experience levels, but if you wish to use mob kills, just make sure to change the lm argument to the score argument. I'll run through all that needs to be done to achieve this. We will make it cost 10xp and 10 kills to open the door.
If using kills, type this in chat: /scoreboard objectives add Kills totalKillCount Kills You can display this anywhere, but I suggest the sidebar: /scoreboard objectives setdisplay sidebar Kills
Let's build it.
Top Command Block: /tellraw @p[r=8,l=9] {text:"You don't have enough money to open the door!",bold:true,color:red} If using kills, change l=9 to score_Kills=9. Bottom Command Block: /testfor @p[r=8,lm=10] If using Kills, change lm=10 to score_Kills_min=10
Command Block: /xp -10L @p[r=8,lm=10] If using kills: /scoreboard players remove @p[r=8,score_Kills_min=10] Kills 10
Before we keep going, we need some coordinates. Build up the rest of your door:
And get the coordinates from two blocks below. You'll need coordinates from both sides.
1) /tellraw @a {text:"The door is open!",bold:true,color:green} 2) /setblock 0 0 0 redstone_torch (coordinates "0 0 0" are the ones we just took from below the door) 3) /setblock 0 0 0 redstone_torch (coordinates "0 0 0" are the ones we just took from below the door) 4) /fill 0 0 0 0 0 0 air (these coordinates are where our button and sign are. Why remove them, you ask? Well, if the button is pushed again, it can remove more points, and it can be annoying if it just sits there. Removing the button and sign prevents these problems)
And we're done! The results:
Week Counter:
Bank System:
Preliminary: /scoreboard objectives add Money dummy Money /scoreboard objectives setdisplay sidebar Money
Now let's build the structure:
Build a platform above the command blocks:
Get the coordinates of both end blocks for where the gates will be and write them down.
Now let's add the commands. You can tell which command goes where by seeing the blocks position in the background and from earlier images:
These command blocks are done. Set the clock going and let's move onto the next part.
Have a button on the other side of the block from the repeater. Deposit Side: 1) /tellraw @p[lm=10,r=8] {text:"Money Deposited",bold:true,color:gold} 2) /tellraw @p[l=9,r=8] {text:"You don't have enough money to deposit!"bold:true,color:red} 3) /scoreboard players add @p[lm=10,r=8] Money 10 4) /xp -10L @p[lm=10,r=8]
Withdraw Side: 1) /tellraw @p[score_Money_min=5,r=8] {text:"Money Withdrawn",bold:true,color:gold} 2) /tellraw @p[score_Money=0] {text:"You have no money to withdraw!",bold:true,color:red} 3) /scoreboard players remove @p[score_Money_min=10,r=8] Money 10 4) /xp 10L @p[score_Money_min=10,r=8]
The last thing we need to do is give the player a way to exit the bank. Easy. Set this up: Command Block: /tp @p 0 0 0 (where 0 0 0 = coordinates of bank lobby)
Enjoy banking with this new system!
"Rounds" System:
The "Mystery Box":
Preliminary: Run these commands in order: Command One: /scoreboard objectives add Money totalKillCount Money Command Two: /scoreboard objectives setdisplay sidebar Money
Let's get building.
Sticky Piston:
Command Block: /blockdata ~ ~ ~ {SuccessCount:1}
Sticky Piston:
Build a platform:
1) /scoreboard players remove @p[score_Money_min=40,r=12] Money 40 2) /tellraw @p[score_Money=39,r=12] {text:"You don't have enough money to use the box!",bold:true,color:red} 3) /tellraw @p[r=12] {text:"Selecting Weapon..",bold:true,color:gold}
Command Block: /tellraw @p {text:"Make good use of this weapon!",bold:true,color:green}
Dropper, block above it, then chest on ground level.
Chest full of your chosen random items, with hoppers transferring them to the dropper. (Be sure to shuffle the items around a bit in the chest to make it random)
That's done. If you want to link it up to a randomized system of your own, then simply connect it to this part of our system:
Playsound:
Whereas [] are optional, locate the sounds at .minecraft\assets\sound\, and name them after the location within the sound folder; so .minecraft\assets\sound\mob\pig\say will become mob.pig.say - it is IMPORTANT to note that numbers (0-9) CANNOT be used when referring to sound files; instead, the command will cycle through numbered files randomly (e.g. say1, say2, say3 will get picked randomly using the referrer mob.pig.say).
[x] [y] [z] coords are NOT referrers for the player's position, they a the set co-ords for where the sound plays from; for example, setting this to 0 2 3 will play a sound at x0, y2, and z3.
[volume] specifies the volume of the sound played (I think the maximum is 10*)
[Pitch] Specifies the Pitch (e.g. 1 will increase it by one octave, -1 will decrease it; decimals are accepted). I'm not sure, but I think the maximum value might be 6*
[minimum_volume] specify a minimum volume value - I think this means that, if the player is distant from the sound, how quietly it will reach before cutting out (essentially acting as a radius for the sound), but it doesn't appear to work
** Denotes uncertainty, or required confirmation.
Custom Potions:
Woah, slow down there! Let's break this up:
"CustomPotionEffects:"
CustomPotionEffects is what is telling the command that we want to add custom effect to the potion.
"Id:2" The id is specifying what effect we want. In this case, ID 2 is Slowness. For effect ID's visit the Minecraft Wiki.
"Amplifier:1" The amplifier is enhancing our potion from basic Slowness I. Keep in mind that an amplifier of 0 is considered Slowness I, so an amplifier of 1 gives us Slowness II.
"Duration:200" The duration is telling our potion how long to apply the effect.
IMPORTANT: Duration is measured in ticks (there a 20 ticks per second) so this potion gives a duration of 10 seconds.So when we put everything together, we get a Slowness II potion with a duration of 10 seconds.
{CustomPotionEffects:Id:2,Amplifier:1,Duration:200}]}
That's all well and good, but what if we want multiple effects on our potion? That's simple enough, all we have to do is add another set of data after what we had previously entered.
IMPORTANT: Be sure to separate your effects with a comma, like shown below.
/give @p 373 1 1 {CustomPotionEffects:Id:2,Amplifier:1,Duration:200},{Id:9,Amplifier:3,Duration:200}]}
This potion now gives us Slowness II and Nausea for 10 seconds. But we want a more interesting name than "Potion of Slowness", to achieve this we can add a custom name to our potion using the display tag.
IMPORTANT: Be sure to lay this out exactly as below, or it will not work.
{display:{Name:Potion of Lead Feet}}
We can now place our custom name into our our pre-made potion as shown below.
/give 373 1 1 {display:{Name:Potion of Lead Feet},CustomPotionEffects:{Id:2, Amplifier:1,Duration:200},{Id:9,Amplifier:0,Duration:200}]} Voilà! We now have a fully custom potion with a custom name.To learn more about DataTags and how they work, head over to minihilly's post HERE.
Setblock:
/setblock x y z [data-method] [dataTag]
Start your command with /setblock followed by the coordinates of where the block should be placed. After the coordinates goes the alphabetical ID of the block being placed (NOTE: Future versions of mine craft will not support numerical ID's, so for a full list of alphabetical ID's, go HERE.). Following the block ID is the block data. Most blocks will have a data of 0, but some block (like wool or logs) heavily depend on data values to change their appearance. The method of which the block is placed after the data value. There are three methods available: "keep" summons the block if the space is empty, "replace" will set the specified block no matter what it formally was, and "destroy" will set the block as well as display the particles of the block being destroyed.
Compared to other commands, /setblock doesn't much in the way of data tags, but here are some that are worthy to note: /setblock ~~1 ~minecraft:skull 1 replace {ExtraType:FireArceus64,SkullType:3,Rot:0} The above will set the block above the command block to a skull with my skin on it, you can change the name to make it anyone else's. For a full list of setblock data tags, go HERE.
Ta-Daa! You have now learn't how to use /setblock. As always, here is a command that shows the full extent of /setblock:] /setblock ~~~minecraft:mob_spawner 0 destroy {SpawnCount:1,SpawnRange:13,RequiredPlayerRange:64,Delay:5,MinSpawnDelay:5,MaxSpawnDelay:10,MaxNearbyEntities:50,EntityId:FireworksRocketEntity,SpawnData:{LifeTime:40,FireworksItem:{id:401,Count:1,tag:{Fireworks:{Explosions:[255,16711680,16776960],FadeColors:[255,16711680,16776960]}]}}}}}
How to use setblock for directional placement:
Hopper: /setblock ~ ~1 ~ hopper 2 2 = North 3 = South 4 = West 5 = East 6 = Down
Ladder: /setblock ~2 ~ ~ ladder 1 1 = North 3 = South 5 = East 4 = West
NOTE: The ladder cannot be next to a block with updates! This means that it is not possible to place multiple ladders above and below each other.
For the door, you will need to run 2 commands.
Door: /setblock ~-2 ~ ~ wooden_door 0 /setblock ~-2 ~1 ~2 wooden_door 8 Once you run these, there should be a full door. You may need to mess around with the damage values though. Now that you have a full door, you can modify its direction by changing the damage value of the first command.
1 = North 2 = East 3 = South 7 = West
Summon:
/summon [x y z] [dataTag] This is the syntax for all /summon commands. Start with /summon followed by the name of the entity/mob you want to spawn E.g Pig, Sheep, PrimedTnt; for a full list of entities and their names, go HERE. After the entity's name are the coordinates of the spawn.
Following the coordinates is were some of the more complex command block functions come in; Data Tags. I'll be covering some of the more commonly used tags, but if you want to learn more you can go HERE or HERE.
So let's spawn a basic Pig:
/summon Pig ~ ~1 ~ Following this is where the data tag goes. Let's give the pig a saddle.
/summon Pig ~ ~1 ~ {Saddled:1} See what happened there? It is very important when using tags that you open and close each tag respectively. The Saddle tag is a boolean value, meaning it is either 1 or 0. What happens if we want the pig to have a custom name as well?
/summon Pig ~ ~1 ~ {Saddled:1,CustomName:"Piggy"} NOTE: We do not have to make a new set of brackets for every tag, simply separate each tag with a comma.
So there you go! Now you can use /summon to spawn entities with great ease. Before I finish, here is an example of the kind of things you can do with /summon.
/summon Skeleton -864 59 327{CustomName:Skeletor,CustomNameVisible:1,SkeletonType:1,Attributes:Name:generic.knockbackResistance,Base:1},{Name:generic.movementSpeed,Base:0.001}],DropChances:0f,0f,0f,0f,1.0f],Equipment:id:261,tag:{ench:id:48,lvl:1}]}},{id:301,tag:{display:{color:0}}},{id:300,tag:{display:{color:0}}},{id:299,tag:{display:{color:0}}},{id:397,Count:1,Damage:1}]}
Tellraw:
If any player has 5 health hearts left (2 health points = 1 heart), then a message like this will appear, to only them:
How it works:
/tellraw is just like a regular /tell message, except you are able to format the text in the message; that is, make the text bold, italic,underlined,
have a strikethrough,make it coloured, and many, many other types of formatting. The command can be use in conjunction with any of the player selector variables.Player includes: 1) Username 2) @a 3) @p
List of valid colour values:
A multi-colour command looks like this:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold}]}
Next, we add a hoverEvent:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,hoverEvent:{action:"show_text",value:"I ate it.."}}]}
Now, let's try that instead with a clickEvent:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,clickEvent:{action:"run_command",value:"/tp @p ~ ~10 ~"}}]}
And everything together:
/tellraw @a {text:"Hello World!",color:green,extra:[{text:" Now tell me.. where is the bacon!?",color:gold,clickEvent:{action:"run_command",value:"/give @p cooked_porkchop 1 0 {display:{Name:BACON!}}"},hoverEvent:{action:"show_text",value:"HERE!"}}]}
And that's how it's done! When it's broken down into parts, it is extraordinarily simple.
More about the /tellraw command (via Minecraft Wiki):
/tellraw Raw JSON text
/testforblock:
Parameters:
<x> <y> <z> The coordinates of the block you are testing.
<blockname> The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
[dataValue] The blockdata to test for. For example, a stone pressure plate has a dataValue of 0, and an activated stone pressure plate has a dataValue of 1.
[dataTag] Tests for block dataTags. (for example, {CustomName:Trophy}). If not specified, the dataTag will process any block dataTag.
-Information gathered from the Minecraft Wiki, as well as a little bit of personal testing. Block data values here.
Execute:
<entity> Selects either the person, mob or other entity where you wish to execute the chosen command.
<x> <y> <z> Specifies the position from where to run the command. You can use relative position/tilde notation to make it a certain distance from the player.
<command> The command you have chosen to run.
Eg. /execute @a ~ ~ ~ particle reddust ~ ~1 ~ 0 0 0 0 100 This will play 100 redstone dust particles at 1 block above the players head.
------------------------------------------------------------------------------------------------- Another version of the command allows the command to be executed only if a specific block is detected:
/execute <entity> <x> <y> <z> detect <x2> <y2> <z2> <block> <data> <command>
<x2> <y2> <z2> The position of the block to check.
<block> The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
<data> The blockdata to test for. For example, a stone pressure plate has a dataValue of 0, and an activated stone pressure plate has a dataValue of 1.
Eg. /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:cobblestone 0 effect @p 11 25 3 true If there is a block of cobblestone 1 block beneath all players, they will have Resistance 3 for 25 seconds. Particles will be hidden.
-------------------------------------------------------------------------------------------------
With some commands, it can only be played at a set of coordinates, and not a player. /execute can help with this, and here is a way to play the command /particle at the players position.
Giving yourself an aura!
Build:
The outcome:
With the second /execute variation, we can play a sound to a player when they are standing on a certain type of block. Let's build it!
Now, if the player stands on TNT, they'll hear the 'hiss' of it being ignited!
Clone:
How it works: The whole idea of this command is to select a region of blocks, copy them, and place them somewhere else in the world.
Parameters:
<x1> <y1> <z1> <x2> <y2> <z2> These coordinates are the two corners of the area you wish to clone.
<x> <y> <z> These are the coordinates of where you wish to paste the copied area. The coordinates will be the lower northwest corner of the region you have selected. Relative position / tilde notation can be used.
[mode] There are 3 different modes to choose from:
1) filtered - Only clones blocks with a certain ID (see blockname below) 2) masked - Copies all blocks except air. Any blocks that are air will be left untouched. 3) replace - copies all blocks and replaces them with the ones that the selected destination. If not selected, it will automatically be replace.
[mode2] There are 3 different modes to choose from:
1) force - Forces the cloning to work, even if the selected region and the destination overlaps. 2) move - Removes the selected blocks and pastes them at the destination. 3) normal - Doesn't move or force. Used when blockname is being specified. If not selected, defaults to normal.
[block] The name of the block you are testing for (eg. minecraft:stone -- now only requires to be: stone -- in 1.8)
Replace Item:
<x> <y> <z> This only works for block mode. It is the coordinates of the block to be modified.
<selector> Selects the player of entity to modify. It must be a player name or target selector.
<slot> Specifies the inventory slot to be modified.
For blocks: slot.container.slot_number where slot_number is replaced with a number specifying the slot. Notes for <slot> usage on blocks :
slot.armor.chest slot.armor.feet slot.armor.head slot.armor.legs -= armor stands, mobs, and players only (though not all mobs will show or make use of the items) slot.weapon -= armor stands and mobs only (though not all mobs will show or make use of the items) slot.enderchest.slot_number - Numbers 0 - 26 slot.hotbar.slot_number - Numbers 0 - 8 slot.inventory.slot_number - Numbers 0 - 26 -= players only slot.horse.saddle -= horses, donkeys, and mules only; item must be a saddle slot.horse.armor -= horses only; item must be a type of horse armor slot.horse.chest.slot_number -= donkeys and mules with chests only - Numbers 2 - 16 slot.villager.slot_number -= villagers only - Numbers 0 - 7
[amount] The amount of the chosen item. Must be between 1 and 64.
[data] Specifies the item data for the item(s) to be placed in the block or entity's inventory slot.
[dataTag] Specifies the dataTag for the chosen item.
Entity Data:
<entity> The entity/entities you wish to modify. Must be an entity UUID or the @e target selector. "A UUID (Universal Unique Identifier) is a 128-bit number used to uniquely identify some object or entity on the Internet." ~TechTarget
<dataTag> Specifies the dataTag elements to be added to, or overwrite elements of, the selected entity.
To prevent all current zombies from picking up loot: entitydata @e[type=Zombie] {CanPickUpLoot:0}
-all information from this section gathered from the Minecraft Wiki.
Spread Players:
<x> <z> The coordinates of the central location to spread selected players.
<spreadDistance> The minimum distance between targets.
<maxRange> The maximum distance (along the horizontal axis from the center of the area) to spread the targets.
<respectTeams> Specifies whether to keep teams together - must be true or false. If true, all players on the same team will be teleported to the same location.
<player> Specifies the targets to spread. Must be one or more player names and/or target selectors separated by spaces (@e is permitted to target entities other than players).
This command is useful for PVP arena's or cooperative custom maps.
-all information from this section gathered from Minecraft Wiki.
Testforblocks:
Just like the /tesforblock command, this command tests for blocks.
<x1> <y1> <z1> <x2> <y2> <z2> These are the corners of the area to test for.
<x> <y> <z> Specifies the lower northwestern corner of the area to be tested.
[mode] Specifies how to match blocks. There are two options:
1) all - every block in the source and destination regions must match exactly. 2) masked - air blocks in the source region will match any block in the destination region. If not selected, defaults to all.
Title:
1) title <player> clear (removes a screen title from the screen) 2) title <player> reset (resets options to default values) 3) title <player> subtitle <raw json title> (specifies the subtitle text) 4) title <player> times <fadeIn> <stay> <fadeOut> (specifies fade-in, stay, and fade-out times) 5) title <player> title <raw json title> (displays the screen title) How it works: This command displays a line of text (title) to the player in the middle of their screen, and it can include a second line of text (subtitle). Titles can fade in and out, and can stay on the screen for however long is specified. They are displayed at the same size of the GUI Scale, and if they are too long, will continue of the edge of the screen.
Parameters:
<player> The player(s) to show the title to.
<raw json title> This can only be used in title and subtitle modes. It provides formatting for the displayed text. Take a look at the /tellraw section from earlier.
<fadeIn> <stay> <fadeOut> Specifies the in-game ticks (20 game ticks = 1 second)
-information via Minecraft Wiki.
Trigger:
How it works: This command is used with /tellraw to let players operate systems made by mapmakers.The objective must be an enabled scoreboard objective of the criteria "trigger". The given value is either added to its existing value, or becomes its new value, depending on whether the second argument is add or set. The value of the objective is only changed for the player who uses the command.
See the scoreboards section for more information! Here is a worked tutorial on how to use the tellraw /trigger command.
1) /testfor @p[score_Bomb_min=1] 2) /execute @p[score_Bomb_min=1] ~ ~ ~ detect ~ ~-1 ~ mossy_cobblestone 0 setblock ~ ~-1 ~ tnt 3) /scoreboard players set @p[score_Bomb_min=1] Bomb 0
Outcome (with a few extra I added):
I made it so that once all 4 pieces of TNT are placed, it automatically resets and players are teleported out to spawn. You could easily make teams, and for each piece of TNT placed add 1 point on the scoreboard. This could result in announcing the winning team and such.
Now, if you want to make mini-games or PVP arenas, this would make an awesome gamemode! Just add some touches of your own and it'll be good to go.
Achievements:
Parameters:
<stat_name> There are three options:
achievement.achievement_name - achievement_name must be a valid achievement name. stat.statistic_name - statistic_name must be a valid statistic name. The symbol * can be used to represent all achievements.
[player] Must be a player name or target selector.
Examples from Minecraft Wiki: To grant the "Overkill" achievement to yourself: achievement give achievement.overkill To grant the "Taking Inventory" achievement to Alice:achievement give achievement.openInventory Alice
To increase the "Mob Kills" statistic by 1 for the nearest player: achievement give stat.mobKills @p
To remove all achievements from all players: achievement take * @a
Difficulty:
<new difficulty> must be one of the following:
peaceful / p / 0 easy / e / 1 normal / n / 2 hard / h / 3
Hardcore is not an available difficulty, as it is not an option in this command.
Gamemode:
<mode> must be one of the following:
survival / s / 0 creative / c / 1 adventure / a / 2 spectator / sp / 3
Hardcore is not an available gamemode as it is technically not a gamemode.
[player] If used, must be either a player name or target selector, but if not specified, it will change the gamemode of the player using the command. When using it in a command block, a player MUST be specified.
Kill:
[player | entity] Specifies the entity to be killed. This can be non-living entities as well. You must use a player name or target selector, and if not specified, it will kill the user. When using it in a command block, an entity MUST be specified. To kill everything, type /kill @e To kill all zombies, type /kill @e[type=Zombie] To kill all pigs in the radius of 20 blocks, type /kill @e[type=Pig,r=20]
A Brief Introduction to Data Tags:
That will rename the item to "Bandage"
As well as this, you are able to do a list of tags, so you can ever further customize items and entities:
{display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}}
This will apply two tags to the chosen item, causing it to have the name "Bandage", and have the lore (line under the name) say "Use this to patch yourself up!" Both these tags are listed under the tag-category "display", as they both change the display of the selected item.
You way also be asking why the 'Lore' tag is using square brackets. This is called an 'array'. Each item in an array is separated by commas, so to add more tags to the 'display' tag category, all you need to do is add more commas.
Here is an example of a /give command:
/give @p paper 5 0 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}}
@p = closest player
paper = our given item
5 = 5 of the item
0 = the damage value (this causes the item to be damaged)
And the rest is what we have discussed.
{ench:[{id:62,lvl:3}]}
This would give you Lure, level 3.
Inside the 'ench' tag are two sub-tags; 'id' and 'lvl'.
'id' specifies the enchantment, and 'lvl' specifies the level of the enchantment.
Now we will give a player a fishing rod with Lure, level 3 enchantment on it:
/give @p fishing_rod 1 0 {ench:[{id:62,lvl:3}]}
And to give the player an item with and enchantment and custom name + lore we do:
/give @p fishing_rod 1 0 {display:{Name:Salmon Snatcher,Lore:["A powerful fishing rod!"]},ench:{[id:62,lvl:3]} As you can see, all we need to do is add one comma after the 'display' tag, and we are able to add our enchantment. And this is the outcome:
If you want to add multiple enchantments to an item, it is as simple as this:
ench:{[id:62,lvl:3},{id:61,lvl:3]}
This will not only give us 'Lure' level 3, but it will also give us 'Luck of the Sea' level 3 enchantment. It is as easy as adding another comma and adjusting the position of the final square bracket.
For a further and advanced guide to dataTags, check out minihilly's guide to Using /summon & /give DataTags in Map-Making!
Bleeding/Bandage System:
1) Scoreboard Values. 2) The bleeding animation. 3) The negative effects. 4) The subtitles. 5) The usage of a bandage.
I will show you how to make this, and explain how it works.
This will make a health counter under the name "Health" Next: /scoreboard objectives setdisplay sidebar Health This will display the amount of health a player has. Note that 2 health = 1 heart. We can now see how total health in a sidebar on the right of the screen:
For the second scoreboard value, we need to type: /scoreboard objectives add Bandage dummy Bandage This is a dummy objective, meaning it can't be altered by anything other than commands. It doesn't need to be displayed as it is only for our mechanics.
Here is the layout for our command blocks. You'll need 2 hoppers, 1 comparator and 2 command blocks:
It doesn't matter which command block you put these commands into, just make sure you have them both:
/execute @a[score_Health=10] ~ ~ ~ particle reddust ~1 ~ ~ 0 0 0 0 200 This will execute the command at all players @a with a maximum Health of 10 (5 hearts). It will be along the x-axis 1 block, and be played the redstone dust particle effect, with 200 particles.
/execute @a[score_Health=10] ~ ~ ~ particle reddust ~ ~1 ~ 0 0 0 0 200 This one is exactly the same, except this time it is inside the player, making it seem as though blood is flowing from a wound.
Here is what it looks like:
First, make a layout like this. You'll need 8 command blocks, 2 comparators and 24 hoppers:
Each hopper connects, making a circuit. Make sure there are 12 on each side.
Now, go to one set of command blocks, and put one command into each block:
/title @a[score_Health=10] title {text:""} /title @a[score_Health=10] subtitle {text:"You're bleeding!",color:red} /effect @a[score_Health=8] mining_fatigue 60 1 true /effect @a[score_Health=8] slowness 60 1 true
Let's see what this does.
At the other end of the hopper circuit, put these four commands into the other four command blocks:
/effect @a[score_Health=8] 7 10 0 true /effect @a[score_Health=8] 11 1 3 true /title @a[score_Health=10] title {text:""} /title @a[score_Health=10] subtitle {text:"Use a bandage to patch yourself up!",color:green}
The outcome:
Firstly, we want to give ourselves the correct item. In chat, type this command:
/give @p paper 5 0 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}} This will give us 5 "Bandages" that we can test our mechanism with.
Now set this up: Command Block: /testfor @a[score_Health=10] {SelectedItemSlot:8,Inventory:[{Slot:8b,tag:{display:{Name:”Bandage”,Lore:[“Use this to patch yourself up!”]}}}]}
Command Block: /scoreboard players add @a[score_Health=10] Bandage 1
Block Two: /effect @a[score_Health_min=9] mining_fatigue 0 0 This removes mining fatigue from the player.
Block Three: /clear @a[score_Health=10] paper 0 1 {display:{Name:Bandage,Lore:["Use this to patch yourself up!"]}} This takes away 1 bandage from the player. Block Four: /say @a[score_Bandage=1] has applied a bandage to their wound! Example: Feare has applied a bandage to their wound!
Block Five: /scoreboard players reset @a Bandage Resets the Bandage dummy score to 0.
Command Block: /effect @a[score_Health=10] instant_health 1 0 Heals the player for 1 second, giving 2 hearts health.
The final image show how to reset the comparator and command block. Take note of nodes.
Make sure all the hopper clocks have 1 item passing around, and then your Bleeding/Bandage system is ready for testing!
Mob Health Bar:
First things first. The scoreboard. Type in this command: /scoreboard objectives add healthbar dummy healthbar
1) /scoreboard players set @e healthbar 18 {Health:19s} 2) /scoreboard players set @e healthbar 16 {Health:17s} 3) /scoreboard players set @e healthbar 14 {Health:15s} 4) /scoreboard players set @e healthbar 12 {Health:13s} 5) /scoreboard players set @e healthbar 10 {Health:11s} 6) /scoreboard players set @e healthbar 8 {Health:9s} 7) /scoreboard players set @e healthbar 6 {Health:7s} 8) /scoreboard players set @e healthbar 4 {Health:5s} 9) /scoreboard players set @e healthbar 2 {Health:3s} 10) /scoreboard players set @e healthbar 1 {Health:1s} 11) /scoreboard players set @e healthbar 20 {Health:20s} 12) /scoreboard players set @e healthbar 18 {Health:18s} 13) /scoreboard players set @e healthbar 16 {Health:16s} 14) /scoreboard players set @e healthbar 14 {Health:14s} 15) /scoreboard players set @e healthbar 12 {Health:12s} 16) /scoreboard players set @e healthbar 10 {Health:10s} 17) /scoreboard players set @e healthbar 8 {Health:8s} 18) /scoreboard players set @e healthbar 6 {Health:6s} 19) /scoreboard players set @e healthbar 4 {Health:4s} 20) /scoreboard players set @e healthbar 2 {Health:2s} 21) /scoreboard players set @e healthbar 0 {Health:0s} 22) /entitydata @e[score_healthbar_min=20,score_healthbar=20] {CustomName:"♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ "} 23) /entitydata @e[score_healthbar_min=18,score_healthbar=18] {CustomName:"♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♡"} 24) /entitydata @e[score_healthbar_min=16,score_healthbar=16] {CustomName:"♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♡ ♡"} 25) /entitydata @e[score_healthbar_min=14,score_healthbar=14] {CustomName:"♥ ♥ ♥ ♥ ♥ ♥ ♥ ♡ ♡ ♡"} 26) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♥ ♥ ♥ ♥ ♥ ♡ ♡ ♡ ♡"} 27) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♥ ♥ ♥ ♥ ♡ ♡ ♡ ♡ ♡"} 28) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♥ ♥ ♥ ♡ ♡ ♡ ♡ ♡ ♡"} 29) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♥ ♥ ♡ ♡ ♡ ♡ ♡ ♡ ♡"} 30) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♥ ♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡"} 31) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♥ ♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡"} 32) /entitydata @e[score_healthbar_min=12,score_healthbar=12] {CustomName:"♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡ ♡"}
Okay, now that that is done, we need to wire it up to a clock.
The command block on the left runs the command: /setblock ~ ~ ~-1 redstone_block And the command block on the right runs this command: /setblock ~ ~ ~1 air
Now link the clock with the command blocks as shown, and every mob that spawns will have the following healthbar:
Enjoy your new mob health bars, and don't forget to pop by Dragnoz's website to check out other cool things he has created!
Timer:
Firstly, we need to run the following commands:
/scoreboard objectives add Timer dummy Timer /scoreboard objectives setdisplay sidebar Timer
Now we build the parts of the timer, like so.
Command Block: /scoreboard players add Seconds Timer 1
1) /scoreboard players reset Seconds 2) /scoreboard players add Minutes Timer 1 3) /scoreboard players test Seconds Timer 60 60 4) /scoreboard players reset Minutes 5) /scoreboard players add Hours Timer 1 6) /scoreboard players test Minutes Timer 60 60
How this works is simple. The first image adds our seconds. In the second image, the clock on the left tests if Seconds has reached 60. If so, it will reset Seconds to 0 and add 1 minute. The clock on the right tests if Minutes has reached 60. If it has, it will reset minutes and add 1 hour.
Deployable Medkit:
With the deployable medkit, you can place down a healing beacon for your teammates to heal at. It has a limited time span, and utilizes spawn eggs for the "deployability."
Before we begin, you'll need to set a scoreboard argument: /scoreboard objectives add BeaconTimer dummy BeaconTimer
This will enable use to make the medkit last only a limited time.
Start by placing down command blocks. The command block on the right is inside a minecart, and can be obtained by using /give @p command_block_minecart It is on top of an activator rail on a redstone block.
Depending on placement, you'll need to change the relative coordinates, but it is as follows:
Left side: /setblock ~1 ~ ~ air
Right side: /setblock ~-1 ~ ~ redstone_block
Next, we need to link it up to a warning message. It tells us that the beacon will soon disappear.
Bottom: /scoreboard players test BeaconTimer BeaconTimer 60 60
Top: /tellraw @a ["",{"text":"HealthBeacon is about to expire!","color":"red"}]
Next we need to setup the disappearing part of the beacon, and the actual healing mechanism.
Upper Command Block: /scoreboard players test BeaconTimer BeaconTimer 100 100
Lower Command Block (on right): /execute @e[type=Item,name=HealthBeacon] ~ ~ ~ effect @a[r=1] regeneration 5
Middle: /scoreboard players set BeaconTimer BeaconTimer 0
Bottom: /kill @e[type=Item,name=HealthBeacon]
That's the first part done. The next part is setting up the Silverfish and Beacon spawning mechanism.
First, setup the mechanism the same way as last time:
Afterwards, we need to do this. One block makes the Silverfish invisible, and the other tests for a Silverfish. Attach a comparator to the "testfor" block. Top: /effect @e[type=Silverfish] invisibility 9999 2 true Bottom: /testfor @e[type=Silverfish]
When the beacon spawns, we'll need to teleport it to the location of the Silverfish. Let's attach it to the main mechanism: Above Mechanism: /tp @e[type=Item,name=HealthBeacon] @e[type=Silverfish]
The next section makes a clean beacon spawn, without any bugs or duplicates: Top: /summon Item ~ ~50 ~1 {CustomName:"HealthBeacon",CustomNameVisible:1,Item:{id:beacon,Count:1},Age:-32768,PickupDelay:32767} Bottom: /kill @e[type=Item,name=HealthBeacon] Left: /scoreboard players set BeaconTimer BeaconTimer 0
Now we attach a comparator and add in a few basic commands: Top: /blockdata ~2 ~-1 ~ {SuccessCount:0} Middle: /kill @e[type=Silverfish] Bottom: /tellraw @a ["",{"text":"HealthBeacon deployed!","color":"dark_green"}]
Now, for the final section we use a different clock. It's a bit slower, and makes it easier to detect change.
AND FINALLY... Give yourself a deployable medkit! /give @p minecraft:spawn_egg 2 60 {display:{Name:Health Beacon,Lore:[Place this down for your teammates, so they can heal!]}}
Enjoy this wonderful new mechanism!
Laser-Tracking Turrets:
These turrets lock on with lasers and shoot you! Get behind them and shut them down! Using the Guardians lock-on ability and a pig with no AI, you can easily make a stationary turret.
I am a terrible builder, but build a turret and set it up like so (the dispenser can remain empty):
That's all folks! Enjoy tormenting players with these difficult turrets!
Kamikaze Donkey:
Summon a donkey and blow it up with a detonator!
Firstly, let's give ourselves a simple book to summon a horse. Because books don't allow to have a long run_command line, you sometimes need to improvise. That's what we'll do: /give @p minecraft:written_book 1 0 {title:"Kamikaze Mule!",author:"",generation:0,pages:["{text:\"Kamikaze Mule\",color:green,bold:true,hoverEvent:{action:'show_text',value:\"Ride this mule to it's death!\"},clickEvent:{action:'run_command',value:\"/summon EntityHorse ~ ~1 ~ {Type:0,Variant:0}\"}}"]}
Next, let's set up a clock to change some of things on this horse. It'll need a saddle... Left: /setblock ~1 ~ ~ air Right: /setblock ~-1 ~ ~ redstone_block Top: /entitydata @e[type=EntityHorse] {Type:1,SaddleItem:{id:saddle},Tame:1,Attributes:[{Name:generic.maxHealth,Base:10},{Name:horse.jumpStrength,Base:0}]}
Enjoy this new, itty bitty, explosively fantastic mule!
xFeare_'s Book of Tactics:
An incredibly overpowered book full of buffs, debuffs and attacks!
There is no tutorial. Just take this command and enjoy! Some mechanisms will NOT work due to them needing to be built using command blocks. This only refers to attacks. All buffs and debuffs should work fine.
The command:
/give @p minecraft:written_book 1 0 {display:{Name:Book of Tactics,Lore:[Enhance your teams' ability!]},title:"Book of Tactics",author:"Officer xFeare_",generation:3,pages:["{text:\"Book of Tactics\",color:gold,bold:true,underlined:true,extra:[{text:\" \",color:dark_red,bold:false,underlined:false},{text:\" Goto > Attacks\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Attacks Page\"},clickEvent:{action:'change_page',value:\"2\"}},{text:\" Goto > Buffs\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Buffs Page\"},clickEvent:{action:'change_page',value:\"3\"}},{text:\" Goto > Debuffs\",color:dark_red,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Debuffs Page\"},clickEvent:{action:'change_page',value:\"4\"}}]}","{text:\"Attacks\",color:gold,bold:true,underlined:true,extra:[{text:\" Fireball\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Summon Fireball\"},clickEvent:{action:'run_command',value:\"/summon Fireball ~ ~1 ~ {Motion:[0.0,0.0,0.0],direction:[0.0,0.0,0.0],ExplosionPower:1}\"}},{text:\" Summon Earth Golem\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Summon Friendly Golem\"},clickEvent:{action:'run_command',value:\"/summon VillagerGolem ~1 ~1 ~ {Attributes:[{Name:generic.attackDamage,Base:4}],HealF:10}\"}},{text:\"Explosions\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Create an Explosion\"},clickEvent:{action:'run_command',value:\"/summon Creeper ~ ~ ~ {ignited:1,ExplosionRadius:3,Fuse:0,NoAI:1}\"}},{text:\" Kamikaze Mule\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Ride this mule to it's death!\"},clickEvent:{action:'run_command',value:\"/summon EntityHorse ~ ~1 ~ {Type:0,Variant:0}\"}}]}","{text:\"Buffs\",color:gold,bold:true,underlined:true,extra:[{text:\" Strength of the Lion (Self-Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Personal Strength Increase\"},clickEvent:{action:'run_command',value:\"/effect @p strength 60 2\"}},{text:\" Lion's Roar (Party Buff) \",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Party Strength Increase\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] strength 30\"}},{text:\" Eye's of the Owl (Party Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Party Nightvision\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] night_vision 30\"}},{text:\" Lizard's Regeneration (Self-Heal)\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Personal Health Increase\"},clickEvent:{action:'run_command',value:\"/effect @p instant_health 1 1\"}},{text:\" Cheetah's Speed (Party Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Increase Party Speed\"},clickEvent:{action:'run_command',value:\"/effect @a[r=10] speed 15 2\"}},{text:\" Resilience (Self-Buff)\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Boost Personal Damage Intake\"},clickEvent:{action:'run_command',value:\"/effect @p absorption 15 4\"}},{text:\"Vanish (Self-Buff)\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Sneak Behind the Enemy\"},clickEvent:{action:'run_command',value:\"/effect @p invisibility 20 2\"}}]}","{text:\"Debuffs\",color:gold,bold:true,underlined:true,extra:[{text:\" Cripple\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Cripple Your Foes\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie] slowness 15 \"}},{text:\" Intimidate\",color:dark_green,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Weaken Your Foes\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie] weakness 15\"}},{text:\" Poison\",color:dark_blue,bold:false,underlined:false,hoverEvent:{action:'show_text',value:\"Poison Your Enemies\"},clickEvent:{action:'run_command',value:\"/execute @p ~ ~ ~ effect @e[type=Zombie,r=5] wither 10\"}}]}"]}
---------------------------------------------------------------------------------------------
Quick Links (Minecraft Wiki):
Contributers:
AstroSpud
Benjakronk
Raecchi
minihilly
FlazeOfAges
TheEpicMoney
And thanks to Dragnoz's tutorials for showing us how to make the Mob Health Bars!
-= A lot of information was gathered from the Minecraft Wiki.
---------------------------------------------------------------------------------------------
I hope this has helped.
Cheers,
Feare
-=Top of Page=-
PVP Map: The Midnight Show
Thank you. I'm going to work on adding more map-based mechanics, and give worked examples of the newer commands such as /trigger and /tellraw. I also plan on creating updated tutorials for the "Buyable" Doors and Experience Bank sections. They could do with a lot of optimization!
Feare To Your Bleeding Tut Is their a way to make the command stop spamming my chat whenever somebody starts bleeding? Without going to options and then changing your chat options?
Also could you do a tut on mob health bar? thank you
If the command block is spamming in chat, all you have to do is type /gamerule commandBlockOutput false. This will stop command blocks broadcasting their commands.
I'll see what I can do about the mob health bar.
*Mob Health Bar made possible by Dragnoz's tutorials!
And for some reason, whenever I click backspace or delete, all the formatting mucks about. I've gone through every individual section and should have fixed most of it up, but if anyone knows what causes the problem, please message me about it! It's starting to get really irritating
Also, feel free to send in anything you've created! I'd love to add it, and as mentioned in the main post, credits will be given to all you contribute!
No problem =)
I plan on remaking the Rounds and "Mystery Box" systems today, but we'll see how we go.
and if you can please show me an example.
It's very simple. When someone selects a kit, make a command block that runs the /clear command, and then make a repeater after that block, giving the player the kit. Like this:
Thread updated with worked /tellraw and /trigger tutorial.
and thats what i've been doing just without the clear command
Looks great! =)
Quote me if you're replying to my comment please.
Check out my maps!
Vampire and Hunter PVP - multiplayer PvP map:
Custom vanilla mobs showcase map:
Collection of two WIP maps (Quad SB and Advanced Village) [MinecraftForum thread]
Cheers!