Talk:Tutorials/Command blocks and functions

This is the new area for submitting ideas, as it is more appropriate.

1. Use the me command, command blocks can dump custom map related flavour directly into the player's chat box. This can be combined with repeaters to give delays or make sure all the text arrives in order.

2. XP for Item Shops. Use give command in combination with a filter to exchange XP for Items. Inspired by MrABgaming and SethBling.

Two Command blocks stacked, with a repeater on a single block.

Top Block Command code: xp -1l @p[lm=5]

Bottom Block Command code give @p[lm=5] 256 1

This gives an Iron Shovel for 1 xp level, provided you have a minimum of 5 levels.

example video: http://www.youtube.com/watch?v=ZDlyLi6ztSg
 * admins, please review, many thanks

3. A "dispense " command, to make command blocks drop or shot items like dispensers do, so you can obtain an infinite dispenser.

4. Some form of conditional statements. (EX: Command checks to see if player has a specific item (named using the anvil) and performs an action if the player has that item) or the block could maybe detect time of day as well.

5. Add colored text options without the need for mods or plugins.

link
A link to this other tutorial would be useful, I would reccomend adding http://www.minecraftforum.net/topic/1491806-minecraft-command-block-tutorial-for-14-new-parametersrelative-teleportation-tutorial/

Spawning Mobs using command blocks?
One thing that has occurred to me recently is that Adventure Map makers have been using command blocks to spawn mobs, more specifically mobs that have custom loot, such as a renamed Iron Sword with Sharpness II and Smite I. This example can be seen on Hypixel's Adventure Map "Herobrine's Mansion".

What the Minecraft Wiki needs to do is add a section on how to spawn mobs with custom loot as described above. Mordakai95 22:30, 1 December 2012 (UTC)

This is using spawners, not command blocks. MrRedstone 21:47, 9 December 2012 (UTC)

MrRedstone, you are aware that Hypixel used command blocks, not spawners. If Hypixel used spawners, he used them for the more common mobs such as zombies wearing skulls. Not bosses. Mordakai95 09:16, 11 December 2012 (UTC)

You can get Command Blocks by typing in the ID number in this: /give @p [ID] (Im not giving the ID. find it to be worthy of it) -Josh_Duke 68.204.230.133 20:28, 3 April 2013 (UTC)

This article needs to say how to do things, not what things can be done. How do I get a command block? how do i set up vanilla minecraft client to be able to use command blocks? There should be a trouble-shooting section.

Read this article Command Block

XP Shop Multiplayer
I created a XP shop on a private server that I run and got a buddy to come test it out with me. We ran into a problem very quickly.

Since I use the @p (nearest player) variable, if the person pushing the button does not have the levels it will take the nearest players levels and give them the item.

With this setup, anyone could join and drain a user of levels by giving them random items like cobble stone.

Is there anyway around this?

Throex '''TALK 02:11, 25 April 2013 (UTC)


 * A bit of a guess here, but try setting the arguments to set the search center to the location of the button, with a small maximum search radius (3 blocks or so). That should keep it from affecting any player who isn't close enough to have pushed the button. -- Orthotope 03:24, 25 April 2013 (UTC)