Minecraft(我的世界)中文论坛
标题: MC1.8:指令方块新的书本和牌子Json教程
作者: PotatoMaster101 时间: 2014-6-19 17:59
标题: MC1.8:指令方块新的书本和牌子Json教程
本帖最后由 PotatoMaster101 于 2015-4-2 17:46 编辑
大家好。今天Mojang出了MC新版本:14w25a。这是2014年第25个星期的快照。这个快照更新了很多东西,还加入了一个新的生物:水下护卫。但是本帖子讲解的是新的书本和牌子Json。这个是/tellraw使用的raw Json message,现在可以用在书本和牌子上了。这个本人不会说太多,因为以前的Syl版主已经发过了Json信息的教程。(教程点击这里)。
首先是牌子,但是在牌子上面是有限制的,牌子只能有4行字,而且每行字也不能太多,太多了显示不下。所以牌子最好显示单个玩家的名字和玩家的分数。这个十分简单,指令:
- /setblock ~ ~1 ~ minecraft:standing_sign 0 replace
- {Text1:"{text:"Hi, ",color:aqua,extra:[{selector:"@p",color:red,bold:true}]}",
- Text2:"{text:"1.8 Json Signs",color:green,underlined:true}",
- Text3:"{text:"Like It?"}",
- Text4:"{text:"Your Score :",color:red,extra:[{score:{objective:"Json",name:"@p"},bold:true}]}"}
复制代码 牌子的NBT本人就不多说了,像Text1,Text2那些。大家看指令第二行有“{text:\"Hi, \",color:aqua,extra:[{selector:\"@p\",color:red,bold:true}]}”,这个就是新加入的Json系统。这个就是牌子显示的第一行,主要是刚开始是显示“Hi,”,然后就显示最近玩家的名字,第二行就是显示“1.8 Json Signs”,第三行显示“Like It?”,第四行显示“Your Score:”,然后显示最近玩家的Json积分板分数。(如果玩家未创建这个“Json”积分板,游戏将会把积分板的位置留空。)
之后来简单的讲一下比较难的的Json,普通的就不多说了。详情去看Syl的教程:
selector:" " - Json内的选择器,写@p,@a什么。选择玩家使用。
score:{objective:" ",name:" "} - Json内显示积分板分数。里面的objective就是变量名称,name就是玩家。这里的name也可以使用选择器(@p)。
之后来说下书本,书本就可以显示的更加全面了。指令:
- /give @p minecraft:written_book 1 0
- {author:"PotatoMaster101",title:"Test 14w25b",pages:[
- "{text:"This is Minecraft 14w25a. ",color:green,underlined:true,extra:[{text:"HAHAHAHA",obfuscated:true,color:dark_blue,underlined:false}]}",
- "{text:"Right now you're reading the new Json text.",color:black}",
- "{text:"Hover your mouse to me.",color:dark_aqua,hoverEvent:{action:show_text,value:"hoverEvent in books."}}",
- "{text:"Hover your mouse to me.",color:aqua,clickEvent:{action:run_command,value:"/kill @e"},hoverEvent:{action:show_text,value:"Click me and see what happens."}}"]}
复制代码 这条指令给玩家一个写完的书。作者显示的是PotatoMaster101。大家看到里面的内容什么都是用Json自定义过了。大家分解完指令后,就会发现:书本内也可以使用/tellraw的Event,比如:hoverEvent, clickEvent等等。这本书一共有4页,前2页只是在文字上面的改动,第三第四页就是开始使用hoverEvent和clickEvent了。
(注意:书本的NBT内一定要加入{title},也就是自定义书名。从14w26c开始,不加入的话Json就会失效。)
第三页的内容是:"text:\"Hover your mouse to me.\",color:dark_aqua,hoverEvent:{action:show_text,value:\"hoverEvent in books.\"",也就是说:会显示"Hover your mouse to me"这些字符,然后当玩家把鼠标移到字的上面,会显示"hoverEvent in books"这些字符。
最后一页就是hoverEvent和clickEvent合并,当玩家鼠标移动到字符上面后,会出现"Click me and see what happens"的字样,当玩家点击字符后,那将会执行一条指令。那条指令是:/kill @e。
接下来就不多说了,这些都比较简单。这个帖子主要是给大家看看格式而已,也不算是是"教程"。新手实在看不懂的话点击这里。(Syl的/tellraw Json教程).
随便创造的指令(未整理):
- /give @p minecraft:written_book 1 0 {title:"PotatoMaster101 OP Book",author:"PotatoMaster101",ench:[],pages:["{text:"Miscellaneous",color:green,extra:[{text:"\n[Day Time]",color:aqua,clickEvent:{action:"run_command",value:"/time set 137"},hoverEvent:{action:"show_text",value:"Set time to day (137)"}},{text:"\n[Night Time]",color:gray,clickEvent:{action:"run_command",value:"/time set 17500"},hoverEvent:{action:"show_text",value:"Set time to night (17500)"}},{text:"\n[Creative]",color:red,clickEvent:{action:"run_command",value:"/gamemode 1 @p[r=0]"},hoverEvent:{action:"show_text",value:"Change to Creative Mode (m=1)"}},{text:"\n[Survival]",color:red,clickEvent:{action:"run_command",value:"/gamemode 0 @p[r=0]"},hoverEvent:{action:"show_text",value:"Change to Survival Mode (m=0)"}},{text:"\n[Adventure]",color:red,clickEvent:{action:"run_command",value:"/gamemode 2 @p[r=0]"},hoverEvent:{action:"show_text",value:"Change to Adventure Mode (m=2)"}},{text:"\n[Spectator]",color:red,clickEvent:{action:"run_command",value:"/gamemode 3 @p[r=0]"},hoverEvent:{action:"show_text",value:"Change to Spectator Mode (m=3)"}},{text:"\n[Kill Players]",color:dark_gray,clickEvent:{action:"run_command",value:"/kill @a"},hoverEvent:{action:"show_text",value:"Kill all players"}},{text:"\n[Kill Entities]",color:dark_gray,clickEvent:{action:"run_command",value:"/kill @e"},hoverEvent:{action:"show_text",value:"Kill all entities"}},{text:"\n[TP All]",color:dark_red,clickEvent:{action:"run_command",value:"/tp @a @p[r=0]"},hoverEvent:{action:"show_text",value:"TP all players to current location"}},{text:"\n[TP Random]",color:dark_red,clickEvent:{action:"run_command",value:"/tp @p[r=0] @r"},hoverEvent:{action:"show_text",value:"TP to a random player"}},{text:"\n[Clear Inventory]",color:blue,clickEvent:{action:"run_command",value:"/clear @a"},hoverEvent:{action:"show_text",value:"Clear all players inventory"}}]}","{text:"Gamerule",color:green,extra:[{text:"\nmobGriefing ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule mobGriefing true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule mobGriefing false"}},{text:"\ncommandBlockOutput ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule commandBlockOutput true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule commandBlockOutput false"}},{text:"\ndoMobLoot ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule doMobLoot true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule doMobLoot false"}},{text:"\ndoMobSpawning ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule doMobSpawning true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule doMobSpawning false"}},{text:"\ndoTileDrops ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule doTileDrops true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule doTileDrops false"}},{text:"\nkeepInventory ",color:gray},{text:"\n[True] ",color:green,clickEvent:{action:"run_command",value:"/gamerule keepInventory true"}},{text:" [False]",color:red,clickEvent:{action:"run_command",value:"/gamerule keepInventory false"}}]}","{text:"Effects",color:aqua,extra:[{text:"\n[Clear Effects]",color:red,clickEvent:{action:"run_command",value:"/effect @p[r=0] clear"},hoverEvent:{action:"show_text",value:"Clear all effects"}},{text:"\n[Night Vision]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:night_vision 99999 255 true"},hoverEvent:{action:"show_text",value:"Night Vision Effect"}},{text:"\n[Strength]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:strength 99999 255 true"},hoverEvent:{action:"show_text",value:"Strength Effect"}},{text:"\n[Haste]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:haste 99999 255 true"},hoverEvent:{action:"show_text",value:"Haste Effect"}},{text:"\n[Speed]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:speed 99999 10 true"},hoverEvent:{action:"show_text",value:"Speed Effect"}},{text:"\n[Invisibility]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:invisibility 99999 255 true"},hoverEvent:{action:"show_text",value:"Invisibility Effect"}},{text:"\n[Resistance]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:resistance 99999 255 true"},hoverEvent:{action:"show_text",value:"Resistance Effect"}},{text:"\n[Jump Boost]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:jump_boost 99999 5 true"},hoverEvent:{action:"show_text",value:"Jump Boost Effect"}},{text:"\n[Regeneration]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:regeneration 99999 255 true"},hoverEvent:{action:"show_text",value:"Regeneration Effect"}},{text:"\n[Water Breathing]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:water_breathing 99999 255 true"},hoverEvent:{action:"show_text",value:"Water Breathing Effect"}},{text:"\n[Saturation]",color:green,clickEvent:{action:"run_command",value:"/effect @p[r=0] minecraft:saturation 2 255 true"},hoverEvent:{action:"show_text",value:"Saturation Effect"}}]}","{text:"Get Item",color:blue,extra:[{text:"\n[Diamond Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:diamond_block 64 0"},hoverEvent:{action:"show_text",value:"Get Diamond Blocks"}},{text:"\n[Iron Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:iron_block 64 0"},hoverEvent:{action:"show_text",value:"Get Iron Blocks"}},{text:"\n[Gold Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:gold_block 64 0"},hoverEvent:{action:"show_text",value:"Get Gold Blocks"}},{text:"\n[Coal Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:coal_block 64 0"},hoverEvent:{action:"show_text",value:"Get Coal Blocks"}},{text:"\n[Redstone Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:redstone_block 64 0"},hoverEvent:{action:"show_text",value:"Get Restone Blocks"}},{text:"\n[Lapis Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:lapis_block 64 0"},hoverEvent:{action:"show_text",value:"Get Lapis Blocks"}},{text:"\n[Command Block]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:command_block 64 0"},hoverEvent:{action:"show_text",value:"Get Command Blocks"}},{text:"\n[Beacon]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:beacon 64 0"},hoverEvent:{action:"show_text",value:"Get Beacon"}},{text:"\n[Potato]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:baked_potato 64 0"},hoverEvent:{action:"show_text",value:"Get Potatoes"}},{text:"\n[Wood]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:log 64 0"},hoverEvent:{action:"show_text",value:"Get Wood"}},{text:"\n[Torch]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:torch 64 0"},hoverEvent:{action:"show_text",value:"Get Torch"}},{text:"\n[TNT]",color:aqua,clickEvent:{action:"run_command",value:"/give @p[r=0] minecraft:tnt 64 0"},hoverEvent:{action:"show_text",value:"Get TNT"}}]}"]}
复制代码 ============END===========
作者: Koke_Cacao 时间: 2014-6-19 18:07
本帖最后由 Koke_Cacao 于 2014-6-19 18:08 编辑
1.8更新对制作地图非常有利,颜色、计分板都能在牌子上显示了(书似乎没啥用)有些插件就可以省去了
作者: Xhand 时间: 2014-6-19 19:52
既然是好基友那就顶个=w=
-------QAQ昔日的基友居然成大神了
作者: PotatoMaster101 时间: 2014-6-19 19:53
当年在爱拍还是小混混的时候 你来了 你是我多年的基友
作者: Xhand 时间: 2014-6-19 19:55
QWQ我只是喜欢玩 荒废了我的前(后)途(路)啊
作者: hsx466911663 时间: 2014-6-19 20:11
谢谢LZ!!!!
作者: 咕噜and呼噜 时间: 2014-6-21 12:46
怎么召唤一个生物
并让它有末影龙一样的血条?
作者: PotatoMaster101 时间: 2014-6-21 12:48
这个好像不行。要一个指令方块装置
作者: 咕噜and呼噜 时间: 2014-6-21 13:00
我本来就是要命令方块的!
作者: PotatoMaster101 时间: 2014-6-21 13:05
我从来没坐过这个装置 你自己去制作吧
作者: 咕噜and呼噜 时间: 2014-6-21 13:06
我不太会命令方块
怎么制作啊!
FFFFFFFFFFFFFUUUUUUUUUUUUUUUCCCCCCCCCCCCKKKKKKKKKKKKKKKKKK!!!!!!!!!!!!!!!!
作者: PotatoMaster101 时间: 2014-6-21 13:10
不知道 本人没研究过这个东西
作者: 咕噜and呼噜 时间: 2014-6-21 13:13
你都不会
我怎么可能会呢?
作者: SuperGameMaster 时间: 2014-6-21 13:15
哇,谢谢分享!!
作者: PotatoMaster101 时间: 2014-6-21 13:35
那就别做了 反正原理就是一个凋零刷怪笼,然后每次打怪一下就会对凋零刷怪笼改进一下 来实现血条
作者: 咕噜and呼噜 时间: 2014-6-21 13:36
哦
大概知道原理了............
作者: 咕噜and呼噜 时间: 2014-6-21 14:00
朋友啊...........
你们........
一个是“垃圾”
一个是大神........
(PS:正在制作你的皮肤,然后再弄C4D效果图)
作者: C-青皮君 时间: 2014-6-30 17:35
直接复制lz关于
书本的代码进入
命令方块后,似乎
并没起效哟~
invalid book tag...
作者: PotatoMaster101 时间: 2014-6-30 17:56
呵呵?可能14w26c的书本什么又变了
作者: PpY_SK 时间: 2014-6-30 18:57
1.8就是奇葩,CB就是奇葩
作者: PotatoMaster101 时间: 2014-6-30 20:35
解决了。自从14w26a开始,所有书本都要带有{title}NBT,也就是自定义书名。否则不可用
作者: C-青皮君 时间: 2014-7-3 09:50
我突然发现做
1.8小游戏的时候
还是现用1.6的NBT
先做一部分比较快捷..
作者: C-青皮君 时间: 2014-7-3 09:54
另外lz请问中括号
一般都是list么?
比如书本的那个
比如Lore那个
作者: C-青皮君 时间: 2014-7-3 09:58
我猜测可以用
Summon来做
可能可以在玩家
周围召唤一个隐形
的凋零、属性方面
去掉移动等等吧...
然后不断刷新
生命值就可以了...
一边探测怪物的血量
提前预设好凋零的血量
跟怪物一样
然后怪物几点血凋零几点血
在删除凋零类似的..
作者: 机兽起源 时间: 2014-7-3 10:04
新人留抓学习
作者: PotatoMaster101 时间: 2014-7-3 16:41
这样很烦 还不如用凋零刷怪笼
作者: PotatoMaster101 时间: 2014-7-3 16:42
[]括号 是List。里面可以:["",""]或者[{},{}]
作者: Seekers_05 时间: 2014-8-28 20:02
RPG通关游览景点用(/TP)
作者: Seekers_05 时间: 2014-8-28 20:09
http://www.mcbbs.net/thread-315309-1-1.html
贰逼的装置~~由生物本体和血条黑龙组成QWQ~~
作者: Seekers_05 时间: 2014-8-28 20:11
末影龙可以但可能要用Attribute
凋零也可能要用~~
作者: Seekers_05 时间: 2014-8-28 20:13
/entitydata可以使用不过略烦
本人打算为怪物每只在一个计分板上一些变量,变量显示血条
(PS:有这个变量叫health,我们Wiki见)
作者: C-青皮君 时间: 2014-8-28 20:23
同学...7.3的快照坟
还没有entitydata...
不过加个好友吧
作者: Seekers_05 时间: 2014-8-28 20:52
1.7.3?!
可以用14w32d及以上不过还是喜欢计分板~~
作者: C-青皮君 时间: 2014-8-28 20:53
7月3日的帖子
作者: PotatoMaster101 时间: 2014-8-28 21:31
直接用HealF应该可以
反正主要是控制刷怪笼内的Boss血量
作者: MC先生 时间: 2014-9-13 13:02
我把指令打進去東西都出不來耶?
把\都砍掉之後雖然出來了,但是都沒內容
我是1.8正式版
作者: PotatoMaster101 时间: 2014-9-13 16:42
测试没有错误
你的MC问题吧 或者你指令方块输入的问题
作者: chiron0987 时间: 2014-9-26 15:32
请问怎样在书本中让extra的内容分行?我想在同一页里有四个点击事件但它们都是连在一起的不好看
作者: PotatoMaster101 时间: 2014-9-26 17:12
在前面加入 \n
{extra:[{text:"xxx"},{text:"\nxxx"}]}
作者: chiron0987 时间: 2014-9-26 18:37
谢谢!最近在用这个做一个传送符的机制,帮大忙了
作者: chiron0987 时间: 2014-9-26 19:17
抱歉,还是不太理解,这个/n应该怎样插进去?比如
/give @p minecraft:written_book 1 0
{title:"book",author:God,pages:["{text:\"222222222222\",extra:[{text:\"3333333\"},{text:\"4444444444\"}]}"]}这个怎样把2,3,4各分一行呢?
麻烦了OTZ
作者: PotatoMaster101 时间: 2014-9-26 19:33
/give @p minecraft:written_book 1 0
{title:"book",author:God,pages:["{text:\"222222222222\",
extra:[{text:\"\n3333333\"},{text:\"\n4444444444\"}]}"]}
你去试试 未试验
作者: chiron0987 时间: 2014-9-26 20:21
成了!!万分谢谢!!之前是我自己想太多了,总以为\n和文本内容中间应该有个符号分隔之类的OTZ
作者: mime888arceus 时间: 2015-1-2 12:16
lz,我想在run_command里弄summon 有nbt的怪的指令,但是命令方块貌似把 那个引号当成指令完成的引号了,能帮我一下吗?谢谢
作者: mime888arceus 时间: 2015-1-2 12:23
pages:[
"{text:\"Summon Magician's Red\",color:red,clickEvent:{action:run_command,value:\"/summon Chicken ~ ~1 ~ {CustomName:"MagiciansChicken",NoAI:1,Invulnerable:1,Riding:{id:Zombie,NoAI:1,Invulnerable:1,CustomName:"MagiciansRed",Equipment:[{id:51},{id:300},{id:300},{id:299},{}],ActiveEffects:[{Amblifier:126,Id:12,Duration:9999999}]}}\"}}"]
这是那指令的一部分。。。
作者: 1755216324 时间: 2015-1-2 12:30
好NB的样子……完全看不懂
作者: PotatoMaster101 时间: 2015-1-2 13:11
你这个引号套的太多了,mc最多套2个
而且json里面最好不要打nbt,因为json内的指令 都有长度限制 打的太多即使是对的也会出错
作者: HC20011015 时间: 2015-1-2 13:16
PM大神再现!
作者: mime888arceus 时间: 2015-1-2 14:31
好的,谢谢:D
作者: Romanbrain 时间: 2015-1-23 12:05
能不能把一大串文本放进书本,而且一页满了自动写到下一页?
作者: PotatoMaster101 时间: 2015-1-23 13:30
我不知道pages会不会自动翻页 你试试
作者: 唔咩 时间: 2015-2-27 17:01
贴在墙上的木牌是minecraft:sign么?
作者: 战神eee 时间: 2015-8-22 21:49
祝你们红尘作伴活的潇潇洒洒{:10_501:}
作者: /盐汽水/ 时间: 2015-8-24 12:18
从来不会用这个
作者: MC微风 时间: 2015-8-24 13:49
撸主太高能,完全看不懂。
作者: wlmy 时间: 2015-8-24 18:13
牛!!!!
作者: CommandBlock丶 时间: 2015-8-31 10:41
多一个装备的英文就更好了
作者: xlyhx 时间: 2016-7-5 19:54
PotatoMaster101,你的指令有点问题
Text后每个单词都得 \"xxx\"
比如
/setblock ~ ~1 ~ standing_sign 0 replace {Text2:"{\"text\":\"Your Score :\",\"color\":\"red\",\"extra\":[{\"score\":{\"objective\":\"Id\",\"name\":\"Punchline\"},\"bold\":true}]}"}
还有,\"name\":\"xxx\" 只能打实名,不能@a、@p等等
作者: PotatoMaster101 时间: 2016-7-6 10:19
写这个帖子的时候版本为1.8,所以并未严格化json,所以text那里没加入\"\"。
之后你说name无法选择器,我去wiki上面看了一下,文章如下:
name: The name of the player whose score should be displayed. Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system. In addition, if the name is "*", it will show the reader's own score (for example, /tellraw @a {score:{name:"*",objective:"obj"}} will show every online player their own score in the "obj" objective). Note that non-player entity scores (such as @e[type=Cow]) do not show, even if the entity has been given a score in the objective.
其中这一段吸引了我的眼球:Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system.
翻译过来意思是:选择器(比如@p)可以使用,还可以使用积分板的假名系统。
作者: xlyhx 时间: 2016-7-6 14:03
哦 谢谢
作者: 366450731 时间: 2020-1-14 22:43
怎么弄一本可以清怪,设置重生点,清药水的指令书
作者: niggurath_ 时间: 2020-1-15 23:34
s属实我不太会
嗷~~~~..
作者: Xmit 时间: 2020-1-16 14:45
理就是一个凋零刷怪笼,然后每次打怪一下就会对凋零刷怪笼改进一下 来实现血条
作者: OftenBlame 时间: 2020-3-5 17:04
考古学前来探索经验