我的世界之命令方块怎样有命令方块

《我的世界》MC玩家如何才能获得命令方块?附上一些实用的指令!《我的世界》MC玩家如何才能获得命令方块?附上一些实用的指令!我尚的大世界百家号《我的世界》MC玩家如何才能获得命令方块?附上一些实用的指令!在沙盒游戏《我的世界》里面,命令方块是一种非常神奇的功能型方块,玩家们可以利用命令方块做到很多无法完成的任务,只不过这个命令方块并不能轻易获得。下面就介绍一下《我的世界》玩家如何才能获得命令方块,最后附上一些实用的指令!我的世界在《我的世界》游戏里面,命令方块不是原版天然生成的一种方块,功能跟作弊器非常相似。玩家如何才能获得命令方块呢?方法有三种:一、玩家在输入框中输入指令/give@a command_block就可以获得一个命令方块了,需要注意一下@a也可以由@q代替,这样同样可以出现命令方块!我的世界二、玩家可以通过开启创造模式获得命令方块,这种方法可以说是最简单快捷的,当玩家得到命令方块之后再换回生存模式就可以了!三、玩家还可以通过作弊模式获得命令方块,开启作弊模式以后再输入指令,这样也能够获得命令方块,这种方法跟创造模式相似!我的世界以上就是《我的世界》玩家获得命令方块的三种方法,最后附上一些实用的指令(命令方块)!1、/weather,修改我的世界游戏中的天气状态;2、/spawnpoint,可以人为设置出生地或者复活点;3、/kill,这个指令可以击杀某一个实体方块;4、/enchant,可以附魔玩家手中的物品或者道具;5、/defaultgamemode,设置想要的默认游戏模式;我的世界6、/blockdata,这个指令可以修改方块的信息;7、/effect,可以给玩家一些药水的影响效果;8、/gamerule,这个是玩家修改游戏规则的指令;9、/setworldspawn,可以设置我的世界游戏世界中心;10、/clone,这个是复制方块的指令,建筑作品方便!我的世界以上就是《我的世界》玩家如何才能获得命令方块?附上一些实用的指令!这里的内容包括命令方块的获得途径,总共有三种,我的世界玩家通过这些方法就能拥有命令方块这种神器了,最后附上的是用于命令方块的一些实用的指令,当然我的世界除此之外还有很多指令,大家可以好好学习一下!《我的世界》MC治疗药水和再生药水有何区别?老玩家告诉你奥秘!盘点一下《我的世界》MC十五种药水,其中七种是增益类药水!《我的世界》MC会不会一直火下去?关键还是看玩家们的选择!《我的世界》MC神秘的巨魔洞窟,居然还隐藏着一个巨大的黑曜石!《我的世界》MC暮色森林八大危险怪物,全部击杀才算是征服模组!本文仅代表作者观点,不代表百度立场。系作者授权百家号发表,未经许可不得转载。我尚的大世界百家号最近更新:简介:痴迷于游戏世界衣带渐宽终不悔……作者最新文章相关文章&>&&>&&>&正文
《我的世界》命令方块怎么用 命令方块使用图文教程
18:33:10 来源:网易我的世界论坛 作者:高大大
  《我的世界》命令方块允许地图制作者事先设定运行命令,从而让地图更加复杂,可用于提升冒险模式体验,今天小编带来“高大大”分享的《我的世界》命令方块使用图文教程,为新手玩家讲解其基础的用法。
  首先,使用命令方块的地图一定得开作弊(生成地图时“更多世界的选项”有)!然后输入这个命令(直接打):
  嗯……那个LTCat换成你们在游戏里的名字。其实/give &玩家名& 137也行,只不过1.8后就不可以了,所以我们还是严谨点好,这个就是给予你一个命令方块的指令。
  放在地上右键,出现这样一个屏幕。这就是你输入命令的地方。
  举一个例子:下面这个命令就是把LTCat的游戏模式改为生存模式的,相信大家熟悉吧。命令方块的命令输入不需要像直接打那样加“/”,但是必须要有一个“目标”(如“gamemode 0”不行,而需要“gamemode 0 LTCat”)。
  输入后点击“完成”,然后给命令方块红石信号,然后我的游戏模式就被改了。
  你要判断命令方块是否得到信号(执行命令)完全可以用红石灯。如下图,亮的红石灯代表这个位置的命令方块得的到信号,会执行指令,反之下面的不能。
  要给命令方块输入命令必须在创造模式,并且有管理员权限(单人就是“作弊”是否开启,联机就是OP)。用修改器得到命令方块,改为创造模式而地图没有开启作弊仍然不可以输入命令。
  并且,生存模式无法破坏命令方块,你用钻石镐也是!
  有些小白会问命令是个啥玩意。但是大家可以用/help指令查看命令列表!/help 2是列表第2页,依此类推。
  如果还搞不懂,你可以用/help [指令名]去查看详细用法。其中“&&”标记的是必选(必须有,没有就报错),“[]”标记的是可选(可有可无,视情况而定)。
  有的命令只能由命令方块输出/testfor就是一个。
  @p、@r、@a指代玩家,图中已经说明了。下图的[玩家名]填写”,就会把所有人的模式修改。当然,如果这个地图是单人的,那么随便你填哪个。但是如果是多人服务器就有讲究了——那也是以后的事情。还有一个@e,是“所有实体”。
  对于较多的命令方块组,可以采用这样的形式。按着Shift放红石就可以放在命令方块上而不会打开指令界面。而半砖不会影响人行走,也可以留个缝修改命令方块命令。
《我的世界》精华文章推荐
更多相关内容请关注:
责任编辑:墨池
本文是否解决了您的问题
用手机访问
扫一扫,手机浏览
相关攻略:
游戏制作:Mojang Studio、Microsoft
游戏发行:网易游戏
游戏平台:PC/Xbox360/XboxOne/PS3/PS4/PS Vita
上市时间:
单机游戏下载
综合热点资讯《我的世界》命令方块怎么获得 有什么作用
本文导航第1页:我的世界命令方块攻略1&第2页:
我的世界命令方块攻略1&
在我的世界中命令方块是一种用于提升冒险模式体验的方块。该方块允许地图制作者事先设定运行系统命令,从而让地图更加复杂。本方块为红石驱动型方块,考虑到其功能,本方块不可合成,仅有管理员才可以放置。
延伸阅读:
目前,创造模式物品栏中无此方块。你可以使用以下命令获取:/give &玩家名& 137。如果要在多人游戏中使用,你必须在server.properties中将enable-command-block的值改成true。
在生存模式中,您可以一击破坏命令方块,但并不会掉落任何物品。
命令方块具有实体附加值,故无法被活塞推动。命令的最大长度为254字符。
类型:固体方块
受重力影响:否
爆炸抗性:?
开采工具:None
可再生:否
可堆叠:是(64)
如果想改变方块执行的命令,右键点击,会出现一个界面。
在玩家名称的位置,可以使用下列缩写:
设置命令的时候,使用在控制台中一样的格式输入&&你必须确定命令作用的目标,所以不可能使用例如/kill这种没有玩家变量的命令。
例如,改变最近的玩家游戏模式为生存,可以用如下格式:/gamemode survival @p。值得注意的是只有在创造模式中才能出现控制方块的命令修改界面。
(责任编辑:)
游戏评分:
游戏类型:
文件大小:23.02 MB
语言:中文
下载游戏:
下载次数:11306
扫一扫下载游戏
关注“蚕豆网”微信公众账号
最新鲜的手游资讯,最麻辣的游戏测评,最全面的游戏攻略,还有那领不完的游戏礼包和最绿色的游戏下载,要啥有啥,应有尽有。
蚕豆网好游多
集游戏攻略、热门礼包为一体,为游戏玩家量身定做的手机游戏小伙伴!
qq飞车即将上线街区车王玩法,在全新LBS玩法——街区车王中,车手们可以挑战附近的地标赛场,打败众多对手...[]
qq飞车手游宠物系统将在4月26日正式上线,版本更新后,16级及以上的车手就可以解锁宠物系统啦!那么宠物系...[]
飞车手游宠物是游戏最新上线的系统,不少的玩家都非常的喜欢,想知道QQ飞车手游宠物到底有哪些,哪一个更加...[]
《DNF》体验服已经更新了五一大型版本的相关活动,这些活动中有着许多之前不曾出现的稀奇古怪的道具材料。...[]
绝地求生近日开始了新地图的第二轮测试,在地图中进行了大量的优化,建筑也变得完整。同时还增加来许多新的...[]
蓝洞今日公布了《绝地求生》中名为“金属雨”(Metal Rain)的新活动模式内容。活动时间为北京时间4月20日1...[]
《战神4》怎么刷经验?游戏中等级高低决定了通关难度,而想要快速提升等级也有快捷的方法,下面小编带来“s...[]
QQ飞车手游宠物怎么得,在4月14日曝光的更新预告中,我们可以看到宠物系统即将在4月29日上架,那么QQ飞车手...[]
游戏类型:
剩余数量:
游戏类型:
剩余数量:
游戏类型:
剩余数量:本站文本內容除另有聲明外,均在知識共享 署名-非商業性使用-相同方式共享 3.0 協議下提供。()
来自Minecraft Wiki
此页面的(部分)内容需要被翻译。你可以帮助我们来此页面
该文章需要整理以符合。如果您可以,请帮我们来让它符合样式要求。
是一种帮助和支持、SMP的自动化和自定义地图。如果你想了解更多细节,请参见页。如果你不知道在某些命令中如何设置x,y,z的值最好先看看。
可以使用在许多事情,改变,改变的状态,或者给你预先指定的。他们在这些领域特别有用:/weather 和 /time set x 命令。他们只能在作弊模式之外。 /time set x 命令很有用,它允许你改变当前预定时间再按下一个开关。
命令方块也可以被用来使文本出现在人的聊天菜单。命令是 tell @p &信息&, 或者 tell &玩家名& &信息&.如果加上@p在tell的后面,那么只有最近的玩家会看到信息. 而如果制定了一个玩家名,那么对应的玩家会看到信息. 你也可以输入: /tell &你的名字& @p ,当有人走过时,它会跟你说:"@ whispers to you: &username&.
你可以用已下命令去改变难度 /difficulty x 0=和平,1=简单,2=普通,3=困难,或者在后面直接打上难度的名字。(例如:/difficulty peaceful)
另外一种使用命令方块的方法是使用代码/tp @p &目的地坐标&在两个不同的基地之间传送。
曲奇给予器 5000X
这个装置会给予一个随机玩家五个曲奇,然后告诉所有人。
首先创建一个(名字任意,注意除非在你测试时,不要显示它),比如说“cookie”(曲奇)
/scoreboard objectives add cookie dummy cookie
第一个命令方块的命令:
/scoreboard players set @r cookie 1
第二个和第三个命令(两者可颠倒,但要同时被激活)
/say @a[score_cookie_min=1] has been given 5 cookies.
/give @a[score_cookie_min=1] minecraft:cookie 5
第四个命令方块的命令
/scoreboard players set @a[score_cookie_min=1] cookie 0
"I" 代表输入红石信号端。(建议可使用循环红石电路)
你可以通过使用/tp x y z来传送。其中y表示上下方向的移动,x和z表示前后和左右方向的移动,玩家可以通过这个命令传送到(x y z)这一个坐标的位置。如果要以目前站的位置为标准进行传送的话就只要在x y z前面加上一个~即可,例如/tp ~x ~y ~z。如果当玩家位于(x y z)坐标为(-36 96 -12)的时候输入/tp @p ~3 ~4 ~5,这时他会被传送到(-33 100 -7)这个坐标,和玩家输入/tp @p -34 100 -8是一个效果。
命令方块同时也可以用来制作安全系统。 只要在你房子入口的铁门前放置一个压力板,输入命令:/tp @p[r=&radius&,name=!&yourname&] &x& &y& &z&。对于怪物,简单的栅栏或熔岩护城河就能达到目的。
类似于电梯的概念,用于使生物沿x或z坐标移动。
这可以通过以下方式创建:
使用/fill command with your coordinates. (/fill x y z x2 y2 z2)
对于填充的块,使用这个:command_block 1 replace{Command:/tp @p ~-1 ~ ~}
编辑括号内的坐标,以改变您将移动的方向。
将压力板放在所有命令块的顶部。
你可能想把命令块提示关闭…因为聊天会被提示疯狂刷屏。
[文件:timereseter.png |拇指|200px ] ]
“Note”: 作为13w24a,有gamerule,dodaylightcycle,可通过在聊天打字获得永恒的一天, /gamerule doDaylightCycle false, and then /time set 6000&/code
通过使用蛛网和矿车,你可以跳过夜晚使用 /time set 0.一个矿车需要31秒穿过一个蛛网。因此,通过使用23个堆叠的蛛网和[检测器轨道]和几个[动力轨]将使太阳保持在天空中。
或者,您可以使用在木质压力垫上产卵的物品。该项目de滋生了垫每5分钟,在这段时间触发的命令块重置为0, also it triggers a dispenser (or dropper) to drop a new item on the wooden pad. 5 Mins is the day cycle and will trigger before mobs spawn. This method however is limited to 64x9 = 576 cycles = 48 IRL hours of gameplay with that chunk loaded. In the snapshot 13w01a and higher, hoppers are added into the game that can pick up items and deposit them into blocks with an inventory. A mob grinder can keep the dispenser full with gunpowder, arrows, and zombie flesh. Another technique is to simply use a command block to create the item out of thin air (e.g.: /summon Item ~1 ~0 ~1 {Item:brown_mushroom}). The advantage to this is that it has no 64x9 item limit like using dispensers does.
Both of these methods require the chunk to be loaded to allow the system to work.
Alternatively, you could connect the command block to a repeating redstone pulse, such as a five-clock, some type of loop, or a daylight sensor as seen on the right. To prevent this filling up the chat box, set the gamerule "commandBlockOutput" to false using the command /gamerule commandBlockOutput false. Note: This method can be used to set a variety of things by using a different command. (I.E. to have eternal sun, add another command block to the loop and use the command /weather clear)
Also, to make it toggle-able, use one of these designs, but put an
before the command block, with a lever on one side, and the mechanism on the other side.
is a more direct approach for eternal day.
The sensor deactivates the Redstone torch which will activate the Command Block which will set the time to 8000 when there's not enough light for the sensor to power the Redstone torch across the far distance. In other words, the Command Block will set the time to Noon when it's dark enough. The light level when the command will be activated varies with the distance of the Redstone wire. The time it sets to varies with the time typed in the Command Block.
To make it, first, you place the Daylight Sensor on an open area. Then you place some Redstone wire away from it. The distance of the Redstone wire depends on your need of precious time. You can only have a max of 15 blocks worth of Redstone wire away from the daylight sensor to send the signal to its destination. Next, you put a block on the other end of the Redstone. Put a Redstone Torch on the block's side and a Command Block on top of the torch. Right click the command block and start with "/time set" and enter a valid time value and the end. The value depends on when you want to set the time to. 14000 is night and 8000 is noon.
This design can be used in maps to keep it a certain time of day/night. This simple contraption can only be used in Creative mode or when you enable Cheats.
There is an alternative, more compact design. If you put a comparator facing away from the sunlight detector and a 15 strength redstone line (one redstone with a torch) into the second input. Then set the comparator to subtraction mode. The comparator will activate right after noon.
then right-click on it to set it to a night sensor. Add "/time set day" to the . Or if you want it to always be night, add a
and don't right-click it, then add "/time set night" to the .
Wireless Redstone can be achieved using s and the
system. The process involves using a scoreboard variable that is searched for by a command block attached to the output of a . A
is then used on the wireless output command block that will trigger when the variable is found true.
Wireless Redstone can also be achieved by using objectives instead of variables. If the output command block is set to try and remove a non-existent objective, a redstone signal can be created by adding said objective via command block or chat command. The advantage to this method over the variable method is that it is not dependent on players.
To do this, place a command block at the input and type the command: /scoreboard objectives add &objective name& dummy. At the output location, place a command block, type /scoreboard objectives remove &objective name&, hook it up to a clock, and put a comparator then a repeater leading out of the command block. Then just use the repeater as an output.
Off state.
On state command.
Off state command.
Wireless output setup.
Wireless output command.
Another way of having wireless redstone using the "/summon" command. The command used here is /summon FallingSand -118 150 -60.5 {TileID:76,Time:1,DropItem:0}
You can also achieve wireless redstone by using the / command instead of the scoreboard system. All you have to do is let the command block set a redstone_block to the destination coordinates - together with an air block (or anything that does not output a signal) being set to the same coordinates from a command block connected to the inverted signal.
This can be done with any block, technically, but buttons, levers, and other interchangeable blocks add an interesting effect. It's surprisingly simple, despite the mysteriousness on servers. It uses the 1.8 command testforblock. The setup is simply a command block, a comparator to translate the command into a redstone signal, a block to be tested for, and a clock to repeatedly activate the command block. Here's the example for a button:/testforblock 123 12 123 stone_button 10. You use the coordinates and name for the specific block you want to test for, in this case a stone button located at 123 12 123. This can be interchangeable for any block that changes data value. The number 10 after the coordinates corresponds the data value of the button that we want the command block to test for. In this case we want the command block to activate when a button facing west is pushed, so we set the value to 10.
Note: this value changes depending on which direction the button/lever is facing. The initial value for a button facing west that is not pressed is 2. When a button is pressed, it adds a value of 8 to the initial state, so a button facing west when pressed would then have a data value of 10.
for the data values.
By using m=, you can make a kit on a server/custom map that can only be obtained once! First, dig 3 squares down in the ground, then place a row of command blocks (one for each item in the kit). In the GUI, type /give[m=&starting gamemode, in number form&] &item id& &amount&. Do this for each item you wish to give. Make an extra command block that has the command /gamemode &a different gamemode than the starting mode&, then string redstone across all of the command blocks (this can be done easily by sneaking and placing). Fill in the hole and place a pressure plate over it. When players walk over it, they will get the desired kit of items and it will change their gamemode so they cannot receive it anymore (unless cheats are used) (Note: This method can also be done by using the method above only using (First name your kit do /scoreboard objectives add &kitName& dummy &kitName&) scoreboard commands! /give @p[score_&kitName&=0] &item id& &amount& for the row of command blocks giving you the items and /scoreboard players add @p &kitName& &any number greater than 0& to make it a one time use. Also you can make more than one kit if you repeat the steps and use a different &kitName&).
是不是已经厌烦了压力板只有四种材质可用了呢(石质,橡木质,铁质和金质)?现在你可以不再为这个问题困扰了。你可以使用包含命令/,区域大小的带有时钟电路的命令方块来代替压力板了。命令/testfor @p[r=2]会检测2格内(朝任意方向两个方块加上命令方块本身的区域内)是否有任意玩家。当命令方块在一层地板下面的时候,r=2刚好是希望达到的效果。记住玩家是在一个球形区域内(而不是方形区域)触发这个命令的,所以r=2的区域大约是5*5*5,r=1的区域大约是3*3*3(其实更像是一个+号上下各加一个方块)。你可以用dx,dy,dz这些参数来编辑命令。你也可以在代码里指定xyz坐标(比如/testfor @p[x=50,y=64,z=46,r=1]),但是注意不能把区域缩小到一个方块。因为在不包含坐标的命令中区域大小代表着命令方块本身加上周围r个方块厚的区域,对于命令方块来说比较合理(如果缩小到只有一个中心方块,那就只有你站在命令方块那个位置时才会触发命令了,所以并不合理)。至少来说一个r=1的触发区域(即+号上下各加一个方块)可以被埋在地层下,只露出上表面,前提是你知道玩家不可能在地表下两层的位置行走。如果实现这一效果且不使用xyz坐标则要求命令方块嵌在地表上,可以被玩家看到。
By swapping gamemode it is possible to use command blocks in single player outside of creative mode. Simply swap to creative mode with the /gamemode 1 command, set the command block command to whatever you want, then swap back to /gamemode 0. The command block only needs to be set in creative, but will still function once back in normal.
It can also be used to teleport to certain areas (for ex. a far-away Stronghold, a deep mining operation, or a floating island). If it took you a very long time to get there, and if you don't mind sort-of cheating, then you can set up a teleport system. Make sure that you are on Creative mode while setting it (use the command /gamemode 1. If you don't have cheats enabled, open the LAN and set the cheats on), but you can still activate it in Survival mode. Type this command in when having the Command Block GUI open /tp @p x y z . Then, activate the command block with redstone (including buttons, levers, and pressure plates), and you will be sent to your far-away destination. You can set up multiple different teleports. This can also be used when doing a big project that spans over a very large area or if you are transferring chests to from an old house to a newer house.
如果一个人希望创造一个单人玩家的探险家地图,做 /publish命令来让其他的命令(见下方)被使用。
这个章节详细介绍了在中的应用。
通过 /tp命令,可以制作一个所有人都可以使用的传送装置。可以在每个地方都使用。 例如,在整个世界里做一个庞大的传送系统,所有的传送点入口都汇集到传送大厅中,而传送大厅可以进入每个传送点入口处进而达到出口。这样就可以建造一个“快速交通中心”了。
"定格动画"
通过使用/tp,或者Minecraft地图编辑器,例如MC地图编辑器可以复制一张图片(利用方块做出来的绘画),然后粘贴到一处遥远的地方,并变动绘画的一些方块,利用一些压力板或者绊线钩,在玩家短时间欣赏绘画后,命令方块做出/tp命令,将玩家传送到下一张绘图点. 如果大量的复制粘贴这样的零件,让玩家按顺序的在这些之间传送并稍稍弄出一点点的延迟,那么玩家就会产生幻觉,认为这个绘画是在运动的(甚至认为是某MOD做出来),这就是利用命令方块来实现定格动画技术。
1.7+里可以使用/setblock来直接放置和删除方块,利用/setblock还可以免除传送时不必要的卡顿和一大堆的房间,而1.8+的/fill更是可以极其方便地放置大量的方块。
用/give @r命令,可以创造一个抽奖。但是记住, /give命令是直接把物品放进他们的背包,而不是放在他们面前。
通过连接高频红石到一个命令方块和用/tp命令,你可以强制玩家留在某个地方。如果你想让这个方法成为可行的,在你的聊天窗内使用命令/gamerule commandBlockOutput false.。使用"Range"(最大范围)和"Minimum Range"(最小范围)两个参数,你可以在玩家离开一定距离后再将他们传送回来。
只针对管理员
如果使用参数[m=1],那么只有创造模式的玩家才会受到这条命令的影响,当然输入m=0既只对生存模式的玩家有效。
戏弄创造模式玩家
你可以放置一个命令方块,输入“/tp @p[m=1] &坐标&”或者一些整人命令。当创造模式的玩家激活这个命令方块就会被传送到某个地方或者变成生存模式,好无聊的恶作剧!
注:使用AutoMessage等服务端插件就可以达到自动公告的功能
通过在命令方块中使用 /me,可以创造一个无人自动广播(需要连接循环红石等不断发出激活信号的红石元件),不需要OP,用1.7+的新命令/tellraw {text:"&信息&"}可以免除开头的[@]并且可以做到悬浮事件和点击事件等。
注:大部分服务器管理插件支持封禁危险物品。
使用 /clear命令, 你可以清除玩家背包中的某物品。具体步骤是这样的,使用 /clear @a(或者某玩家ID) &清除的物品名&。如果想实现自动清理危险品需要连接循环红石。
使用/say @p,命令方块就能报告最近的玩家。如果命令方块放在终点线后,他会很方便的说出赢家,但是/say会给所有玩家发送信息,为了防止刷屏,建议使用/tell或/tellraw。
建立保护区域
注:Residence等服务器领地插件的拓展插件可以实现领地内游戏模式的变化。
你可以通过命令方块创造一个“创造/生存模式区域”,但是很繁琐。可以通过用命令方块的范围限制来制作一个“围栏”,通过围栏的玩家会变成生存或创造模式。在命令方块中输入命令
/gamemode 2 @a[x=&区域中心坐标& y=&区域中心坐标& z=&区域中心坐标& r=&最大的玩家搜索半径& rm=&最小的玩家搜索半径&] 这样放置两个搜索区域不重合的命令方块,就可以将规定半径内的玩家改变模式。
使用命令 /gamerule keepInventory true 来关闭玩家死亡后的物品掉落(同样在重生后会保留物品和经验等,所以需要在玩家重生后清空背包) 。使用 /give @p &物品ID&可以给予玩家武器(可以添加NBT标签),你可以设计一套完善的职业系统,玩家选择不同的职业会有不同的装备。使用 /spawnpoint [x y z坐标] 设置玩家重生地点,使用 /tp [x y z坐标]移动地图中的玩家到指定区域。
新手工具包
你可以很简单的给新手工具包不用任何插件使用命令方块: "/give @p[r=2] 274".
为了防止有人第二次按下按钮得到他们的工具包,您可以设置按钮激活两个命令方块:: 1. "/give @p[r=2,m=2] 274" 2."/gamemode 0 @p[r=2]"(玩家一开始是冒险模式,获得工具包后调成生存模式,然后再限定工具包仅限冒险模式能拿即可)
特殊的彩字
虽然你不能够直接输入彩色/粗体/斜体文本到命令方块中,但是通过McEdit滤器可以编辑那些服务器内的文本。
同时/tellraw可以直接利用color等参数来弄出彩色字体
当玩家走上踏板时,他能触发命令方块 /say @p &警告内容&
如果某个玩家在服务器有着过人的贡献或者有元老资历,但却不足给他管理,你可以奖励他一组钻石或者一些奇怪的东西....
创建一个只有通过传送命令才能进入的房间,将有卓越贡献的玩家传送进去,玩家会激活房间中的命令方块从而获得奖励,而后他又会被另一个命令方块传送回原地,如果服务器允许/back的话,连续2次传送到原点,这样/back就无效了。(可以避免玩家二次领取奖励)
使用/toggledownfall和/weather thunder来开始或者结束降雨(雷雨。)合理安排这个命令的权限会十分有用, 你可以顺随自己的意愿开始或停止降雨。这个技术可以用于村民和一些由降水控制的红石机械,不用输入任何命令就可以控制天气(需要管理员激活命令方块自动执行), 合理利用将会十分有效,比如在森林火灾时或者在雨天刷怪
使用/tp @p 和 /give @p,你可以制作一个障碍赛跑或者奖励迷宫,游戏结束后就将玩家传送汇出生点或其他地方。
在地图上模拟两个十分相似的环境,通过命令方块将玩家从一个传送到另一个,并且时间也会被设置为开始的时刻,这就好像是时间倒退。
注:可以广泛用于剧情RPG地图。
使用命令/testfor @p[r=&检测范围&,name=&玩家名(如果没有限制可不写)&] 使用红石中继器连接命令方块和TNT,当命令方块检测到有玩家经过就会激活TNT!Boom!
注:命令方块的/testfor命令为一次性命令,命令方块检测到一次就会一直输出信号,如果需要多次性的话,你可以直接使用/summon召唤出TNT。
通过使用 /testfor @p[r=5,name=&房主&],命令方块会在一定范围内检测房主并且为他开门,也只会为他开门。
注:命令方块的/testfor命令为一次性命令,命令方块检测到一次就会一直输出信号。
这一节详细介绍了命令方块在自定义地图的应用。
Minecraft中使用大量命令方块的地图有很多优势。
比如:SethBling's TF2 Map
另一个优秀的应用例子是 Hypixel's Gladiator Arena,这个地图中的战斗职业系统完全依赖于命令方块。
“沉默的”命令方块
在地图中控制命令方块不输出提示信息很重要,这可以保持玩家对地图的未知性和剧情的隐蔽性,如果玩家看到了各种命令的提示信息,地图将会索然无味。 关闭命令方块输出信息(除非是/say这类的命令)使用/gamerule commandBlockOutput false就可以实现。
庇护所/角斗场
使用压力板或者绊线 (以安全城堡为例)设置进入城堡内的玩家为和平模式(对于不同区域视情况而定)。城堡大门可以有连接命令方块的绊线,玩家一旦走过绊线,激活命令方块,就会变为和平模式,这样就可以创造一个“避难所”。反之,你可以用同样的方法创造一个“困难模式区域”,所有玩家进入会变为困难模式。
对于不同游戏模式玩家的控制
使用值[m=1]你就可以设置命令只对创造模式的玩家有效,生存模式就是[m=0]。
例:传送所有创造模式的玩家到254,47,-874,使用的命令为 /tp @a[m=1] 254 47 -874
“联合”住宅
在房间的入口或者出口设置一个 /tp 命令的命令方块,你不必将你的建筑都在同一个地方建设,它们可以在任何地方,只需要入口的命令方块传送过去,玩家会忽然觉得外面感觉很小的建筑内部空间竟如此之大。用这种方法联合多个建筑,可用作与服务器或单人地图中的场景瞬移。
使用 /spawnpoint 可以设定玩家出生地点。(应用十分广泛,PVP地图,RPG地图等等)
之前的内容提到过,/gamerule keepInventory true可以在玩家死后保存背包物品。 在跑酷地图的出发点设置一个这样的命令方块,就可以使掉落熔岩死亡的玩家不会丢失物品,同时记录点可以用/spawnpoint来做。
我要睡觉!
使用 /spawnpoint 可以直接设置出生点,但是要跳过白天就需要 /time set &时间& 命令,18000为夜晚(并非绝对,可以按喜好设置,不要少于12500),这样就可以模拟出睡觉的效果了。(可用/time set 700 直接转为白天,/spawnpoint命令和/time set 700配合不就行了么?)
时间和天气下的场景
比方说,你的地图开始在一个寒冷的暴风雨之夜,你可以设置突然天晴了,外面有灿烂的阳光(光影mod么?)!或者,如果你想开始一个光明的一天,想让雨突然下起来又没办法?不要怕,有/weather命令。只需使用/weather,输入就行了!你也可以使用/time set输入:0是凌晨,6000是中午,12000是黄昏,18000是午夜(月亮还挂在头上呐!)。
检测玩家是否切换到了和平模式
创建一个攻击型生物,把它放在压力板上。(请确保它会保持始终按下状态,所以一定要确保它不能跳或走开)。做一个红石电路,让压力板在没有接收到红石信号的时候激活命令方块。命令方块里设置一个消息,通知玩家的地图由于和平模式了已经损坏,需要的怪物已经消失,必须重新下载这个地图。你甚至可以做一个隐形传输命令方块,把那些故意切换到和平模式的玩家换成冒险模式后传送到一间基岩屋内,并让他不能使用/kill或/tp命令,并把他的重生点设在那个房子里,让他永生见不得光明!(单人的话,可以点“对局域网开放”,或用修改器)
Talking Adventure Map(featuring an easy Quest System!)
/say命令非常有用因为它可以直接给玩家发送消息. 用将会更好,这样你就不需要放很多的告示牌和编页码长到不行的书来告诉玩家游戏规则. 你只需要把命令方块放成一条线然后在中间铺中继器来弄各个语段之间的延迟(so the player isn't spammed)接着你就可以把那堆告示牌和放着书的箱子移走。
有一些是和NPC配合使用的. 想象一下你进了铁匠铺并且你想要让里面的铁匠说些什么。在命令方块出现之前, 你需要一些书和告示牌来充当对话的效果, 然后在铁匠铺里造些房间并放些杂物,这样会让这个铁匠铺看起来变得非常乱,但是现在,你只需要使用/say命令来制造铁匠说话的效果. Maybe a pig behind the counter will even beg for mercy! Let's take another example: you are in a factory and an alarm suddenly rings and says that it's going to explode. Having it in the chat, especially if the text is long, keeps the same thing works for bomb timers. The player will get more into the map's mood if the chat displays '10...' '9...' '8...' also.
Last but not least, it makes it easier to create a Quest System. Let's say the player gets in a butchery. He activates through a pressure plate connected to a RS NOR Latch (so it can't be activated twice) and a command block with the /say command in which the butcher asks for the player's help: he needs to kill a pig (shame on him). The player gets to the pig that is standing on a stone pressure plate, that turns off when the pig is dead. So, when the player gets back to the butchery, he activates another circuit containing yet another RS NOR Latch and two command blocks with two commands. First, the /say command in which the butcher thanks the player, and other one, the /give command, so the player gets the reward. Along with that, don't forget to use the @p command so the butcher says the player's name. For example, if the command block is set to do this: /say Thanks, @p. You helped me a lot killing that pig., the channel will say: "@]: Thanks, &name of the player&. You helped me a lot killing that pig." This makes the map way cooler and looks like it's made for the player as it says his/her name!
使用/give @p[lm=(等级)] (物品) (数量)和/xp -(等级)l @p[lm=(等级)] ,你可以创建一个使用经验交易物品的商店系统。例如,如果你创建了一个使用/give @p[lm=5] 2 64的命令方块以及一个使用/xp -5l @p[lm=5]的命令方块,并把它们连接到同一个红石电路,那么激活时就会从最近的玩家身上扣除5级经验并给他64个草方块。
* Subtracting xp CAN work as a currency, by using the command /xp -3l @p[lm=3] where l (L for level) is subtracted. The minimum xp for the command to work can be listed inside the brackets, where lm is short for minimum level necessary.
You can make a Store using xp as a currency. Just place a command block before all the others with the following instructions:
/testfor @p[lm=5] with a Comparator in front of the command block. That way you can only do the trade if you're at least at level 5 (in this case, but you can choose what level you want).
*The last two "updates" are pointless, as the [lm=(level)] in the first post will keep players from getting the item or losing their xp unless they are that level or higher. so if the command says [lm=5], they will NOT be able to use the "store" if they are level 4 or below, but WILL be able to if they are level 5 or above.
The blocks must be in order for this to work. If the blocks are powered at the same time, the cost block will subtract as per normal, but the block giving the item will not function unless your level is double or higher what the cost of the block is. (example: item costs 5, you have 7 levels, you will lose the 5 levels, but will not gain the item. You would only receive the item if your starting level is 10 or higher) The fix for this is to power the blocks linearly, give block first followed by xp block.
Minecarts over floating rails created with the setblock command.
在1.7版本中, the command block gained an expanded potential. 也就是
命令的添加, and can be used to automatically build structures, 填充箱子, 以及生成以前不能生成的实体。 下面是这些命令的语法:
setblock的使用方法:/setblock &x& &y& &z& &方块名& [数据值] [旧方块处理方式] [数据标签]
summon的使用方法:/summon &实体名& [x] [y] [z] [数据标签]
setblock命令也可以用于做突然消失的地板或突然出现的墙。
setblock命令的例子:
* MobSpawners pt 1: The Basics
This code will create a zombie spawner 2 blocks from you in the x direction. Note that the name given for mob spawners in this code ("minecraft:mob_spawner") is the long version and you can leave out the "minecraft:" part.
/setblock ~2 ~0 ~0 minecraft:mob_spawner 0 replace {EntityId:Zombie}
This next code is also pretty basic but it includes the 6 basic parameters that can be set.
/setblock ~0 ~-1 ~-3 mob_spawner 0 replace {EntityId:Skeleton,SpawnRange:4,RequiredPlayerRange:16,SpawnCount:4,MaxNearbyEntities:6,MinSpawnDelay:200,MaxSpawnDelay:800}
A few things to note:
A) All times are in game ticks (20ths of a second). 200-800 is 10-40 seconds.
B) Keep in mind that they are in groups of 2 and won't work if their partner is missing. SpawnRange requires RequiredPlayerRange (and vice-versa), MinSpawnDelay requires MaxSpawnDelay, and I assume SpawnCount needs MaxNearbyEntities (although I haven't actually heard confirmation on that last one).
C) There is also a parameter called "Delay" which contains the amount of time before next spawn (20 ticks for the first time, whatever random number it picks between MaxSpawnDelay and MinSpawnDelay every other time).
D) the coordinates given are ~0 ~-1 ~-3 (so 3 blocks in the negative Z direction from the commandblock's current position and 1 block down). This presumably will imbed it in the surface of the floor. Keep in mind that a spawners "SpawnRange" setting only applies horizontally not vertically. Vertically it will only spawn at the same height or 1 lower or higher, so imbedding it in the surface of the floor cuts the available spawn area by 2/3rds (but can help hide it). Naturally occuring spawners have their height cut by 1/3rd due to appearing 1 block above the floor instead of 2.
E) All the values used here are the defaults.
* MobSpawners pt 2: Custom monsters
Now we get into the SpawnData. That's the stuff that tells the spawner you want a non-standard version of a monster, like a Zombie with a Diamond Sword and a Chainmail Helmet.
/setblock ~ ~1 ~ mob_spawner 0 replace {EntityId:Zombie,SpawnData:{Equipment:[{id:276,Count:1},{},{},{},{id:302,Count:1}]}}
Using ~ without any number after it in the coordinates counts as zero. Since none of those 6 parameters from last example are used they will all be defaults.
Note that the 5 equipment slots are: Hand, Boots, Legs, Chest, Helmet. You must even specify empty slots (the { }, parts) unless they're after the last non-empty slot. So if you want him to have a helmet you have to specify all 5 slots, but if it's just a weapon you can leave off the other 4. Or if you want him to have leg armor you have to specify weapon and boot slots but not chest and helmet slots.
By the way, creatures that burn in sunlight are safe if they have a helmet on, although it damages the helmet instead.
About the Count tag: most codes can get away with leaving it out, however it is important. An item without a count tag is a stack of zero, better known in the community as a "Ghost Item". A player trying to use a ghost item will have it disappear out of his hands with it's first use (which is a failure). While monsters can use ghost items without problem (hence why codes get away with leaving it out sometimes) if they drop the items the player who picks it up won't be able to use it, SO INCLUDE COUNT!
Next up we have a Skeleton with an enchanted bow (Flame), a custom mobhead (Spider, internet connection required or it's just steve) with Protection 2, and riding a Skeletal Horse.
/setblock ~2 ~1 ~2 mob_spawner 0 replace {EntityId:Skeleton,SpawnData:{Equipment:[{id:261,Count:1,tag:{ench:[{id:50,lvl:1}]}},{},{},{},{id:397,Count:1,Damage:3,tag:{ench:[{id:0,lvl:2}],SkullOwner:MHF_Spider}}],Riding:{id:"EntityHorse",Type:4,Tame:1,SaddleItem:{id:329,Count:1,Damage:0}}}}
Well actually sitting on a Skeletal Horse, since the lower creature controls the movement and the horse isn't hostile. Don't try zombies on horseback, they just sit there ineffectually while the horse eats grass and snorts. Luckily this is a skeleton and can shoot you from wherever the horse decides to wander.
As for the horse itself, it's type 4 (skeletal horse), Tame is set to 1 (yes), and it's got a saddle (and the fact that they make us specify which saddle hints that they may eventually have more than one type). Technically you can have multiple levels of riders, although this gets silly quickly.
MobSpawners pt 3: SpawnPotentials
Using the SpawnPotentials tag lets us create a mobspawner with multiple mobs in it. It will randomly pick one each time it resets the timer (a second after spawning the previous mobs). Since these codes contain multiple mobs they tend to be quite long codes. Thanks to some youtuber whose name escapes me (Dragnoz) the fact that you can "break up" your code is known (command blocks ignore line breaks, so you can start a new line to clarify where one section ends and another begins and it won't ruin your code). Here's a more easy on the eye version of a SpawnPotentials code
/setblock ~0 ~1 ~1 mob_spawner 0 replace {EntityId:Zombie,SpawnRange:6,RequiredPlayerRange:12,SpawnCount:1,MaxNearbyEntities:6,MinSpawnDelay:100,MaxSpawnDelay:600,SpawnData:{Equipment:[{id:268,Count:1},{id:301,Count:1},{id:300,Count:1,tag:{display:{color:5013401}}},{id:299,Count:1,tag:{display:{color:6717235}}},{id:397,Count:1,Damage:3,tag:{SkullOwner:Reimac}}]},SpawnPotentials:[
{Type:Zombie,Weight:4,Properties:{Equipment:[{id:268,Count:1,Damage:58},{id:301,Count:1},{id:300,Count:1,tag:{display:{color:5013401}}},{id:299,Count:1,tag:{display:{color:6717235}}},{id:397,Count:1,Damage:3,tag:{SkullOwner:Reimac}}]}},
{Type:Skeleton,Weight:2,Properties:{Equipment:[{id:267},{id:301,Count:1,tag:{display:{color:1644825}}},{id:300,Count:1,tag:{display:{color:1644825}}},{id:299,Count:1,tag:{display:{color:1644825}}},{id:397,Count:1,Damage:3,tag:{SkullOwner:2insanepeople}}]}},
{Type:Zombie,Weight:4,Properties:{Equipment:[{id:272,Count:1},{id:305,Count:1},{id:304,Count:1},{id:303,Count:1},{id:397,Count:1,Damage:3,tag:{ench:[{id:0,lvl:2}],SkullOwner:Flixnore}}]}},
{Type:Zombie,Weight:4,Properties:{Fire:2400,Equipment:[{id:283,Count:1,tag:{ench:[{id:20,lvl:1}]}},{id:317,Count:1},{id:316,Count:1},{id:315,Count:1},{id:86,Count:1,tag:{ench:[{id:0,lvl:2},{id:1,lvl:10}]}}]}},
{Type:Zombie,Weight:4,Properties:{Equipment:[{id:267,Count:1,tag:{ench:[{id:16,lvl:2}]}},{id:309,Count:1},{id:308,Count:1},{id:307,Count:1},{id:397,Count:1,Damage:3,tag:{ench:[{id:0,lvl:2}],SkullOwner:2zqa}}]}},
{Type:Zombie,Weight:1,Properties:{Equipment:[{id:278,Count:1,tag:{ench:[{id:16,lvl:4},{id:17,lvl:4},{id:18,lvl:4},{id:21,lvl:3},{id:34,lvl:3}]}},{id:313,Count:1,tag:{ench:[{id:1,lvl:4},{id:2,lvl:4}]}},{id:312,Count:1,tag:{ench:[{id:3,lvl:4}]}},{id:311,Count:1,tag:{ench:[{id:0,lvl:4}]}},{id:397,Count:1,Damage:3,tag:{SkullOwner:MHF_Herobrine,ench:[{id:0,lvl:4},{id:1,lvl:4},{id:3,lvl:4},{id:5,lvl:3},{id:6,lvl:1}]}}],CustomNameVisible:1,CustomName:Herobrine,PersistenceRequired:1}},
Wow that's a mouthful! But then it is 6 separate mobs. In order we have:
0) Before the "SpawnPotentials" tag: The starter, which will never pop up again after the first time. If we want to see him again we have to include him a second time under SpawnPotentials. He is just some random dude in bluejeans (blue dyed leather leg armor) and a cactus green shirt (green dyed leather tunic) with a wooden sword. He's a zombie under that random-dood-mobhead of his of course. They all are.
1) Same random dood, only this time his wooden sword is 2 hits away from breaking.
2) Hey who let a ninja into the game?!? This one is a skeleton under his mask, but he's been given an iron sword. All his leather armor is dyed ninja-black. Skeletons with swords close the gap quicker than zombies so watch out.
3) Stone Sword and Chain Armor guy. Protection II on his mobhead.
4) One of my favorites. Gold Sword, Golden Armor, Pumpkin Helmet, and ON FIRE!!! Originally I wanted to give him a flaming pumpkin helmet but I realized the Fire tag only applies to entities not armor. The pumpkin is enchanted with Protection II and Fire Resistance X (10!) in a desperate attempt to keep him on his feet and threatening the player for more than 5 seconds. It works but if the player plays keepaway then Mr Pumpkinhead does tend to burn to death. Oh his sword has fire aspect too.
5) Iron Sword and Armor guy. Sharpness II on his Sword, Protection II on his mobhead.
6) Diamond Weapons and Armor guy. Wait who is that. Is...is that...Oh Em Gee it is! Run!...No of course it's not really him. Because he doesn't exist. FakeHB here has highly enchanted Diamond Armor (Boots with Fire Protection IV and Feather Falling IV, Leggings with Blast Protection IV, Chestplate with Protection IV, Mobhead with Protection IV, Fire Protection IV, Blast Protection IV, Respiration III) and a Diamond Pickaxe enchanted with Sharpness IV, Smite IV, Bane of Arthropods IV, Looting III and Unbreaking III. He's also got the previously unseen CustomNameVisible (set to 1 for yes), a CustomName, and PersistenceRequired (set to 1 for yes). That last one will prevent him from ever despawning, although he can be killed normally. If you can get through that Diamond Armor. And level 4 resistances. Luckily he's rarer (see below).
Other than the ninja it's a straight tour of the 5 tiers of swords and armor. Note the Weight tag, used right after the mob name in each SpawnPotential. That determines how rarely it's picked. Specific numbers don't mean anything, just the ratios between the numbers. For example if you want all the potentials to have an equal chance just set all the weights to 1. Changing them all to 8 wouldn't do anything different (they're still all the same size as each other), however changing all but one to 8 would make that one 1/8th as likely as the rest. In this code 4 is the default. The ninja only has a weight of 2 (making him half as likely to be picked) and FakeHB has a weight of 1 (making him 1/4th as likely to be picked, and thank god!)
* MobSpawners pt 4: Rideable Monsters
Mobs can be ridden by using Minecarts or Boats on their heads. The command is fairly simple
/setblock ~ ~1 ~ mob_spawner {EntityId:MinecartRideable(or Boat), SpawnData:{Riding:{id:&Entity&}}}
Some mobs simply can't be spawned with a spawner, sad to say, like bosses and Iron Golems. Adding a Minecart isn't going to change that.
Hostile Mobs with shooting abilities can and will use them against survival players. Watch out.
Ghasts cannot be ridden. The minecart becomes stuck in their head, no use to anyone.
Endermen cannot be walked around, but they can be forced to teleport by shooting a projectile at them ( snowball).
Ocelots (Ozelots in the game format) are some of the fastest mobs to ride, seeing they're trying to get away from you. They can also be partially controlled, by pointing away from the place you want to go.
Spiders are the only mobs that slow down when ridden.
Slimes and their cousins, Magma Cubes (game format LavaSlime) cannot have their sizes changed.
New commands
There are several new commands and tags added in 1.8. One of the most useful being @e. It allows the player to target entities.
You can now teleport creepers, or kill a minecart. Others include /fill, /clone, /execute, /worldborder (set|health, etc}, /trigger, /title, /blockdata, /testforblocks, and /stats.. Check out the s page to see how they work.
You can now create passwords with command blocks, using /testforblock. Place a command block. This will be the one you put input in. Place another command block, and type in the command /testforblock (x,y,z of first command block) command_block 0 {Command:(input)}. Here's an example: /testforblock ~2 ~ ~ command_block 0 {Command:That's Numberwang!}. Place a comparator connected to the second command block, and place a button on or next to it to power the block. Now type "That's Numberwang!" (without quotes). If the second command block properly finds the first, the comparator will activate whatever it's wired to. If you want the first command block to reset so the password isn't used by someone else, also place a command block with /setblock that activates after the /testforblock.
If you don't want to let people edit your command block, you can test for a
instead, but this means having to test for the password separately on each of the sign's 4 lines. To add a touch, you can fill the sign with air, but remember to give it back using /give @p sign
This allows you to destroy a cube of materials around you as you walk, using /execute. Here's the command: /execute @p ~ ~ ~ fill ~1 ~2 ~1 ~-1 ~0 ~-1 air. Attach a clock or some sort of repeating device to it, and the cube of air will follow you wherever you go. Confused? fill takes out a specified amount of space, similar to setblock, but it uses two xyz's and fills the space in between them with the material you choose. In this case it's air. Now, every time you move, it will fill a 3x3 cube of air around you. Great for enemy bases, or simply being a crazy griefer.
This also deletes water, so you basically become a moving sponge.
This works in any game mode, even spectator.
This is a reversed version of Destroyer. /execute @p ~ ~ ~ fill ~1 ~-1 ~1 ~-1 ~-1 ~-1 grass. This puts a 3x3 grass square under your feet. Only problem: Don't jump. It becomes a mountain of a problem.
The player can make a kind of world guard using the command block. (e.g. code: / &模式:[0|1|2|3]& @a[r=&radius&])
Using the radius argument with a teleporter hooked up to a clock circuit can be used to create an exclusion zone ("forcefield") around an x y z coordinate (which should not be centered on the command block itself, otherwise it will be difficult to edit or disable it later). Simply program it to teleport any player within a certain range to a further away point, or just back 10 meters using relative coordinates. Note that such a forcefield wouldn't know which direction you were approaching from, and may result in pulling a player in before pushing them back out the other side.
The commands / Hello, @p, / @p Hello, @p, and / Hello, @p will cause the command block to say user name of the nearest player in the message.
You can also clear players inventories, to prevent griefing and/or cheating: / &玩家& &物品& &数据& &最大量& &数据标签&
Command Blocks can create spawners using the setblock command, e.g.: / ~1 ~-1 ~0 mob_spawner 0 replace {EntityId:Zombie,SpawnData:{Equipment:[{id:276,Count:1}]}} Anything that counts as an entity can be spawned (except a player), which includes all hostile, neutral and passive mobs, as well as animals, minecarts, fireballs, arrows, snowballs, ender pearls, custom thrown potions, fireworks, primed TNT, falling sand, red sand, or gravel, paintings and item frames, experience orbs, and even dropped items of any type.
Pig/Cow/Chicken spawners can be placed in the butcher's backyard in a village to create a constant meat supply. E.g.: / ~1 ~-1 ~0 mob_spawner 0 replace {EntityId:Chicken,MaxNearbyEntities:10,RequiredPlayerRange:16,SpawnCount:6,SpawnRange:2,MinSpawnDelay:50,MaxSpawnDelay:200,SpawnData:{Riding:{id:"Pig"}}} Note that the spawner in the last code example will spawn a chicken riding a pig. There doesn't seem to be a limit to how many levels of riders you can use (e.g.: a chicken riding a pig riding a cow riding a horse riding a silverfish riding a villager ("Say, that's a mighty odd hat you have on, Farmer Brown")).
Please note that if you want to use the RequiredPlayerRange tag you have to use the MaxNearbyEntities tag as well. Same deal with MinSpawnDelay and MaxSpawnDelay. Lastly, note that the y value used in both of those spawner example codes was ~-1, which (assuming you're not flying) will put the spawner in the surface level of the ground at your feet.
If you don't want to target a specific player, you can use @a, @p, or @r instead of &player&. Keep in mind that you can use @p (which means "closest player") in player issued commands as an easy to type 2 character replacement for your own name as the closest player to you will always be you.
The most lethal booby trap would be a command block set to teleport someone into the .
As of 1.8 you can do / @e[r=2] in a command block below a block with a pressure plate to make a multi-use landmine that kills all nearby entities upon stepping on it (including players, item frames, and paintings)
Note that booby traps that use @p can be dangerous due to the fact that non-player entities could trigger them (if something like a
is used), resulting in the teleportation of the nearest player, no matter how far away they are and regardless of the fact that they haven't actually stepped on the plate. To get around this, you can either use the / command as an invisible pressure plate, or you can do / @p[r=radius] x y z. Hook a clock circuit up to a command block programmed with / @p[x=1, y=2, z=3, r=radius], with the coordinates changed as appropriate. Note that as of
a range of zero can now be specified.
It is possible to make teleporters using the command block. (e.g. code: / @p x y z) Taking it one step further, a teleporting station can be made, with multiple button-activated teleporters that each teleport to different locations. Scouting and testing teleportation destinations first is advisable, to make sure players don't end up stuck inside blocks or in other unintended places. If you appear in ground while testing coordinates, use / @p ~0 ~8 ~0 to get out (may require multiple uses).
If you use the teleport command with the command block, you can use relative coordinates in the destination coordinates by placing an ~ in front of a Coordinate (e.g. code: / @p ~0 ~8 ~0 This would teleport the player 8 blocks into the air).
Commands that use coordinates (e.g. / or /) add 0.5 to whole numbers when no decimal follows. This is so you appear centered over the block you appear on instead of at the edge or corner of it. For example, the number -33 would execute as -32.5, and 187 as 187.5. To prevent this behavior, add .0 (25.3, 90.0) after them, as these values are executed left as-is.
With the 1.8 update, you can now also teleport minecarts or boats, with you in them. The command is /tp @e[type=Boat] (coordinates).
There are several ways to combine groups of commands into just one command.
/execute will run its command as many times as the number of targets it selects. If it doesn't matter what entity runs a particular command, you can use @e[c=10] to ensure the code always runs 10 times (as long as there are always at least 10 entities in the loaded world).
To run multiple commands, /summon a command-block minecart riding another command-block minecart riding another, with the commands in reverse order, on an . There are also commands called one-command mods that use this tactic. Mr. Garretto makes one-commands and maps .
This will allow server owners to sell effects, items, and more to any player using level ups and exp. All they have to do is press one button
In his recent videos, Sethbling uses a
as a scroll to perform commands (summon creatures, teleport). He has an empty map in his inventory and when he uses it, it becomes a filled map which immediately disappears and a redstone task is done. In this tutorial I will show you how to build a redstone mechanism to detect the use of a map as a scroll and perform a task (give an effect, open a door,...).
Fast redstone interaction.
Compact system.
At-will triggered system, just right-click to activate it.
Single use : the map disappears during the inventory check, but you can give it back through a /give command
There can only be one purpose for the scroll. I.E. you cannot do a scroll of teleporting and a scroll of strength without using complicated data values.
You may see the map animation when activating the map before it gets deleted.
You cannot use the map item during your playthrough (showing a text message, a path, a drawing,...).
Building the mechanism
You can change the display name of an item to give the player a better understanding of the object and use the tooltip display. Use the following command to give the player a custom named map :
/give &player& map 1 0 {display:{Name:"&displayName&",Lore:["&tooltip&"]}}
player : the player you want to reach (@p, @a[arguments],...).
displayName : the name displayed when you scroll in the hotbar or when you hover the item with your mouse.
tooltip : the text below the item name when you hover it.
Detecting the activation of the map
The two hoppers form a redstone clock. You can use other clocks shown .
The Command block 1 contains the /give command described in the section above. It can be dismissed if you don't want the scroll to come back after being activated.
The Command block 2 contains the inventory check command :
/clear &player& filled_map
The Command block 3 is the output in case of success. You can do whatever you want : give an effect to the player, teleport him somewhere,... You can also wire this output to a door, a piston,...
Going further
The /clear command can check for other interactive items :
check for a glass_bottle if the player just drank a potion.
Sethbling also uses a
which works when the line is reeled in. The /clear syntax involves another argument, the damage value, after the item name:
/clear &player& fishing_rod 2
Note that spamming the reel, or hooking a mob, may damage it more than 2, so make another one of these every 2.
Command block: /setblock x y z minecraft:sand
1st Piston Front: Showing to set /setblock x y z to that position
Repeaters are risen by 1 block from 1-3 so you can see them
1(Repeater): Set to 1
2(Repeater): Set to 3
3(2 Repeaters): Set to 4 and 2
4(Repeater): Set to 2(Default)
5(2 Repeaters): Set to 4 and 1
6(2 Repeaters): Set to 4 and 4
7(Repeater): Set to 2
8 and 9(Repeaters): Set to 4 and 4
1(Repeater): Set to 4
2(Repeater): Set to 4
3(Repeater): Set to 4
4(Repeater): Set to 1(Default)
5(Repeater): Set to 1
6(Repeater): Set to 1
8(Repeater): Set to 4
9(Repeater): Set to 2
10(Repeater): Set to 2
存储解决方案
使用服务器
架设服务器
(IRC频道)
制作Minecraft媒体
Promotional Content}

我要回帖

更多关于 我的世界之命令方块 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信