Blogs Tutorial

Minecraft Command Blogs | Blockdata, CanDestroy and @e

  • 19.1k views • 0 today
  • 15
  • 9
  • 12
Pepijn
Lvl 58 • Grandmaster Cyborg
385
Minecraft Command Blog
by Pepijn96
Blockdata, CanDestroy and @e

Blockdata
In Minecraft 1.7 you had to destroy and replace the chest when you wanted to add items to it. But in 1.8 you can just adjust the blockdata of the block by using /blockdata. It works like this, if you have a chest with 1 grass block in the first slot, you can add other items by using /blockdata x y z {Items:[{id:,Slot:,Count:}]}. For example:

/blockdata ~ ~1 ~ {Items:[{id:stone,Slot:1,Count:2}]}

We also can use the tag "Lock" in 1.8. This allows you to lock the chest. For example:

/blockdata ~ ~1 ~ {Lock:Secret}
This will lock the chest which can only be opened when the player holds a item with the name "Secret"

/blockdata ~ ~1 ~ {Lock:}
This will unlock the chest

CanDestroy
Formerly you were able to destroy blocks in adventure mode when you were given the right tool for it, so a shovel for dirt and an axe for wood. This feature has been removed now. But we can now use the tag CanDestroy. When you add {CanDestroy:[""]} to a datatag string of a tool, you can set what blocks you can destroy using that tool in adventure mode (so this does not effect you in creative and survival mode)! For example:

/give @p diamond_shovel 1 0 {CanDestroy:["minecraft:grass","minecraft:glass"]}

@e
Besides @p,@a and @r, we now can use @e! This allows you to teleport specific mobs and even other entities like FireBalls. You can even use it in /kill now. Be aware that Players are also entities
Some examples:

/tp @e ~ ~10 ~
this teleports every entity 10 blocks above its former position.

/tp @e[type=Spider] @p
This teleports every Spider it can find to the nearest player to the block.

/tp @e[type=PrimedTnt,c=-1] @e[type=SnowBall,c=-1]
This teleports the nearest PrimedTnt it can find to the nearest Trown SnowBall it can find :P.

/kill @e[r=5,type=Creeper]
This kills every Creeper within a radius of 5 blocks.

/clear
Yes, it's finally here! You can now use Datatags and amounts with the /clear command! This allows for specific Item removal, and even allows to check for items in a players inventory, because you can just set the amount to 0. For Example:

/give @p lever 1 0 {display:{Name:"Key"}}
and
/clear @p lever 0 0 {display:{Name:"Key"}}

Want more?
Do you want me to do more of these sort of updates? Let me know by commenting. Be aware of the fact that these command are still in beta, not everything will work properly yet! Check out my other blog about 1.8: www.planetminecraft.com/blog/minecraft-command-blogs-clone-fill-and-tp/

Pepijn96

More like this

  Have something to say?

Dragon7725
• 08/23/2016 9:29 pm
• Level 4 : Apprentice System
Thank you so much. Im working on a map called Mirror World and I needed this. Favorite and diamond for you good sir.
1
TheJared802
• 06/11/2015 12:01 pm
• Level 43 : Master Nerd
"/tp @e[type=PrimedTnt,c=-1] @e[type=SnowBall,c=-1]"

What exactly does the data tag "c" do? I've seen it used in a lot of different places, but have personally not yet found a use for it. (No, I'm not a noob. You'd know that if you were to take one glance at my tutorial blogs.)
1
Roroo
• 07/31/2017 9:08 am
• Level 44 : Master Pig
c means count
1
Pepijn
• 06/11/2015 12:43 pm
• Level 58 : Grandmaster Cyborg
c=-1 or c=1 is usually used for players to pick the last or first player, respectively, in the tab list. It also used to work for entities (first and latest spawned) but it's a bit messed up atm I believe.

Why use it? Because it allows you to target just ONE consistant entity what prevents a lot of systems from messing up.
1
TheJared802
• 06/13/2015 1:57 am
• Level 43 : Master Nerd
Thanks! I understand now and see how this can easily be put to use. Thank you for the explanation!
1
MEplaysMC
• 12/31/2014 5:29 pm
• Level 2 : Apprentice Explorer
its saying unbalanced quotation minecraft:grass
1
Pepijn
• 12/31/2014 9:36 pm
• Level 58 : Grandmaster Cyborg
Fixed
1
Luigi888
• 10/25/2014 10:28 am
• Level 50 : Grandmaster Programmer
Whats the nbt-tag for the time left in a brewing stand? I really need to know!
1
Pepijn
• 10/25/2014 12:32 pm
• Level 58 : Grandmaster Cyborg
{BrewTime:} is for how long an Item has been brewing in a brewingstand (in Ticks!), all items brew for 20 seconds. Good luck with the math :P
1
Luigi888
• 10/26/2014 3:37 am
• Level 50 : Grandmaster Programmer
Thank you!
1

Welcome