命令方块数字密码锁制作教程及原理解析
命令方块数字密码锁制作教程及原理解析。那下面游戏园小编就给大家分享一个关于数字密码锁的制作方法吧!那这个是用命令方块制作的,那到底是怎么制作的呢?那下面就一起来看看吧!下面还有该数字密码锁的原理解析哦~希望对大家有所帮助。
游戏园我的世界官方群: 325049520 游戏园我的世界二群: 256070479 欢迎各路喜爱我的世界的小伙伴们加入讨论!玩服务器的小伙伴们可以加入: 464651602 群一起联机玩游戏哦!如果你有心仪的作品或者心得分享的话,欢迎来游戏园投稿,大家可以点击>>>投稿<<<进行投稿哦~ 有奖品哦~
虽然密码锁很多大触都做过,但是原理不同。相比较庞大的红石密码锁,命令方块密码锁自然小巧的多(然而我并没有任何贬低红石密码锁的意思)
下面上图
一扇简陋的门
你按下了按钮,然而门没开,而是弹出一个奇怪的东西
你选择了乱输
然后再次按下按钮,输入正确的密码(1252893)
命令方块数字密码锁制作教程及原理解析。那下面游戏园小编就给大家分享一个关于数字密码锁的制作方法吧!那这个是用命令方块制作的,那到底是怎么制作的呢?那下面就一起来看看吧!下面还有该数字密码锁的原理解析哦~希望对大家有所帮助。
游戏园我的世界官方群: 325049520 游戏园我的世界二群: 256070479 欢迎各路喜爱我的世界的小伙伴们加入讨论!玩服务器的小伙伴们可以加入: 464651602 群一起联机玩游戏哦!如果你有心仪的作品或者心得分享的话,欢迎来游戏园投稿,大家可以点击>>>投稿<<<进行投稿哦~ 有奖品哦~
虽然密码锁很多大触都做过,但是原理不同。相比较庞大的红石密码锁,命令方块密码锁自然小巧的多(然而我并没有任何贬低红石密码锁的意思)
下面上图
一扇简陋的门
你按下了按钮,然而门没开,而是弹出一个奇怪的东西
你选择了乱输
然后再次按下按钮,输入正确的密码(1252893)
(命令方块君露馅了)
门开了
使用方法
首先输入代码:
/summon FallingSand ~ ~2 ~
{Block:redstone_block,Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~-1 ~-1 ~ ~-1 ~-31 ~ redstone_block},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~-1 ~3 ~ ~1 ~-31 ~ air},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~7 ~-21 ~ {Block:redstone_block,Time:1}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/setblock ~8 ~-21 ~3 iron_block},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~6 ~-18 ~-2 ~11 ~-18 ~2 bedrock},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/setblock ~5 ~-19 ~ wall_sign 4 0 {Text1:"{text:'-------',color:gold,bold:true}",Text2:"{text:'移除模块',color:blue}",Text3:"{text:'右键此木牌',color:blue}",Text4:"{text:'-------',color:gold,clickEvent:{action:run_command,value:'/fill ~ ~-2 ~-2 ~6 ~2 ~2 air'}}"}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~10 ~-18 ~-1 {Block:redstone_lamp,Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a Check 0},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players operation 输入 Number += @a InputNumber},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~10 ~-17 ~1 {Block:redstone_lamp,Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a True 0},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players set @a InputNumber -1},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~9 ~-16 ~-1 {Block:redstone_lamp,Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True_min=1] ~ ~ ~ title @a title {text:"密码正确!",color:green,bold:true}},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Input_min=1] ~ ~ ~ scoreboard players set @a Input 0},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~9 ~-15 ~1 {Block:redstone_lamp,Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True=0] ~ ~ ~ title @a title {text:"密码错误!",color:red,bold:true}},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players operation 输入 Number *= @a Ten},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~8 ~-14 ~-1 {Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set 输入 Number 0},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_Check=0,score_Check_min=0] ~ ~ ~ scoreboard players set @a True 1},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Input_min=1] ~ ~ ~ tellraw @p {text:"",extra:[{text:" "},{text:" 1 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 1"}},{text:" "},{text:" 2 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 2"}},{text:" "},{text:" 3 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 3"}},{text:"n"},{text:" "},{text:" 4 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 4"}},{text:" "},{text:" 5 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 5"}},{text:" "},{text:" 6 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 6"}},{text:"n"},{text:" "},{text:" 7 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 7"}},{text:" "},{text:" 8 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 8"}},{text:" "},{text:" 9 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 9"}},{text:"n"},{text:" "},{text:" < ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players operation 输入 Number /= @a Ten"}},{text:" "},{text:" 0 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 0"}},{text:" "},{text:" ← ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a Enter 1"}}]}},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~8 ~-13 ~1 {Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a Enter 0},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True_min=1] ~ ~ ~ /},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Input_min=1] ~ ~ ~ scoreboard objectives setdisplay sidebar Number},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~7 ~-12 ~1 {Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ tellraw @a {text:"nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"}},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players operation @a Check -= @a Keyword},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~ ~ ~-1 ~3 ~2 ~-1 redstone_block},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/summon FallingSand ~7 ~-11 ~-1 {Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard objectives setdisplay sidebar},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players operation @a Check = 输入 Number},Time:1,Riding:{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~ ~ ~1 ~3 ~2 ~1 air},Time:1}}}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~7 ~-11 ~-1 ~10 ~-9 ~1 air},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~6 ~-10 ~-2 ~11 ~-7 ~2 stained_glass 8},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/fill ~6 ~-10 ~-2 ~11 ~-10 ~2 bedrock},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/tellraw @a {text:"模块生成完毕",color:aqua,bold:true,extra:[{text:"nn"},{text:"使用方法:先使用指令/scoreboard players set @a Keyword <密码> 设定密码(必须为纯数字)",color:yellow},{text:"然后在铁块内侧的命令方块最后的/后添加密码正确时执行的指令,最后将锁芯放在红石机关后,启动后左下角会出现密码输入框,输入密码试试看吧",color:yellow},{text:"nn"},{text:"获得锁芯",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:'/give @a command_block 1 0 {BlockEntityTag:{Command:/scoreboard players set @p Input 1}}'}},{text:"nn"},{text:"作者:SkeletonXiaobai",color:gray,bold:true}]}},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard players set @a True 0},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard players set 输入 Number 0},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard players set @a Ten 10},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard players set @a InputNumber -1},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Check dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Input dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Keyword dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Number dummy ==|请输入密码|==},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add True dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Ten dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add Enter dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/scoreboard objectives add InputNumber dummy},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/gamerule commandBlockOutput false},Time:1,Riding:
{id:FallingSand,Block:command_block,TileEntityData:{Command:/gamerule sendCommandFeedback false},Time:1
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
然后便会生成出这样一个东西:
(那几个红石灯只是装饰,空着的话强迫症看不下去)
以及会弹出这一段话:
点击“获得锁芯”,就会得到一个命令方块,这个命令方块内部自带指令,把它放在门后面,先用“/scoreboard players set @a Keyword xxx”(详见图上)设置密码,然后给命令方块接上红石机关,撸开上图中铁块及铁块后面的玻璃,在里面那个命令方块最后的“/”后加上密码正确后执行的指令(比如帖子开头的演示就是在这里用setblock将门下方的红石火把换为空气,因为这个门本来就是开的,只不过是横过来放的,所以按按钮后门没反应),然后激活命令方块,就会像开头演示中那样弹出密码输入框。
PS:必须再允许作弊的情况下使用,否则密码无法输入!
我建议最好也不要在多人游戏中使用,因为侧边栏显示分数是针对所有玩家的,所以你输入密码时所有人都能看到。。。
原理讲解
先给命令方块们标号
(图中标号的顺序就是命令方块中指令执行的顺序,下文按该顺序讲解指令)
首先是单次执行的指令,一些基础设置:
1.
/gamerule commandBlockOutput false
关闭命令方块的输出,超频必备
2.
/gamerule sendCommandFeedback false
关闭指令在聊天栏里的输出,于commandBlockOutput不同的是,commandBlockOutput仅对命令方块的输出有用,而无法关闭tellraw附带的run_command所执行的命令的输出,而sendCommandFeedback可以做到这一点。简单的说,如果不用这个指令,那么在输入密码时,点一下数字,聊天栏里就会蹦出一行“将xxx的xxx分数设置为xxx”。
3.
/scoreboard objectives add InputNumber dummy
添加一个名为InputNumber的计分板,这个计分板用于记录玩家每次输入的数。
4.
/scoreboard objectives add Enter dummy
添加一个名为Enter的计分板,瞬时计分,用于探测玩家按下了确定键(就是密码输入框右下角的左箭头)
5.
/scoreboard objectives add Ten dummy
添加一个名为Ten的计分板,常量计分板,用于输入密码时的乘除运算。
6.
/scoreboard objectives add True dummy
添加一个名为True的计分板,瞬时计分,用于记录玩家密码是否正确。
7.
/scoreboard objectives add Number dummy ==|请输入密码|==
添加一个名为Number的计分板,显示名称为“==|请输入密码|==”,就是之后显示在侧边栏里的计分板,用于记录玩家输入的密码。
8.
/scoreboard objectives add Keyword dummy
添加一个名为Keyword的计分板,用于记录正确的密码。
9.
/scoreboard objectives add Input dummy
添加一个名为Input的计分板,瞬时计分,探测玩家是否开始输入(也就是激活锁芯)。
10.
/scoreboard objectives add Check dummy
添加一个名为Check的计分板,这个计分板用于按下确定键后比对输入的密码和正确的密码是否一致。
(8个计分板。。。我火星可好?)
别急,基础设定还没结束。。。
11.
/scoreboard players set @a InputNumber -1
将玩家的InputNumber值设为-1,因为输入的密码中包括0,所以默认值不能为0~9
12.
/scoreboard players set @a Ten 10
将玩家的Ten值设为10,因为密码采用10进制。这个值设定后将不在变动,参与输入密码时的进位运算。
13.
/scoreboard players set 输入 Number 0
将假名“set”的Number值设为0,也就是将这个假名加入计分板。
14.
/scoreboard players set @a True 0
将玩家的True值设为0,也就是默认为输入错误,在密码比对成功时才赋值为1。
基础设置到此结束
锁芯里的指令:
/scoreboard players set @p Input 1
将玩家的Input值设置为1,也就是启动瞬时计分板。
下面是超频指令,按标号顺序讲解
1号命令方块:
/fill ~ ~ ~1 ~3 ~2 ~1 air
2号命令方块:
/fill ~ ~ ~-1 ~3 ~2 ~-1 redstone_block
超频不解释。
3号命令方块:
/execute @a[score_Input_min=1] ~ ~ ~ tellraw @p {text:"",extra:[{text:" "},{text:" 1 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 1"}},{text:" "},{text:" 2 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 2"}},{text:" "},{text:" 3 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 3"}},{text:"n"},{text:" "},{text:" 4 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 4"}},{text:" "},{text:" 5 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 5"}},{text:" "},{text:" 6 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 6"}},{text:"n"},{text:" "},{text:" 7 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 7"}},{text:" "},{text:" 8 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 8"}},{text:" "},{text:" 9 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 9"}},{text:"n"},{text:" "},{text:" < ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players operation 输入 Number /= @a Ten"}},{text:" "},{text:" 0 ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a InputNumber 0"}},{text:" "},{text:" ← ",color:green,bold:true,underlined:true,clickEvent:{action:run_command,value:"/scoreboard players set @a Enter 1"}}]}
发现Input值≥1的玩家后在聊天栏里输出一段带有json标签的文字,格式如下:
<3x空格> 1 <3x空格> 2 <3x空格> 3
<3x空格> 4 <3x空格> 5 <3x空格> 6
<3x空格> 7 <3x空格> 8 <3x空格> 9
<3x空格> < <3x空格> 0 <3x空格>←
也就是输出那个密码输入框
其中点击数字0~9后执行的指令为:
/scoreboard players set @a InputNumber *
也就是点击数字几就把玩家的InputNumber值设为几。
点击“<”后执行的指令为:
/scoreboard players operation 输入 Number /= @a Ten
将假名“输入”的Number分数除以10取整。删除输入的密码的各位只要将密码除以10即可。
点击“←”后执行的命令为:
/scoreboard players set @a Enter 1
将玩家的Enter值设为1,启动Enter瞬时计分板。
4号命令方块:
/execute @a[score_Input_min=1] ~ ~ ~ scoreboard objectives setdisplay sidebar Number
发现Input值≥1的玩家后将计分板Number添加到侧边栏。
5号命令方块:
/execute @a[score_Input_min=1] ~ ~ ~ scoreboard players set @a Input 0
发现Input值≥1的玩家后将玩家的Input值设为0。
6号命令方块:
/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players operation 输入 Number *= @a Ten
发现InputNumber值≥0(因为密码输入时的值包括0)的玩家后将假名“输入”的Number值x10。
7号命令方块:
/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players operation 输入 Number += @a InputNumber
发现InputNumber值≥0的玩家后将假名“输入”的Number值加上玩家的InputNumber值。
这两个命令方块合起来就是一旦玩家点了某个数字,已输入的密码就回x10并加上这个数。
8号命令方块:
/execute @a[score_InputNumber_min=0] ~ ~ ~ scoreboard players set @a InputNumber -1
发现InputNumber值≥0的玩家后将玩家的InputNumber值设为-1,也就是初始化。
9号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players operation @a Check = 输入 Number
发现Enter值≥1的玩家后将假名“输入”的Number值存入玩家的Check计分板中。
10号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players operation @a Check -= @a Keyword
发现Enter值≥1的玩家后用玩家的Check值减去玩家的Keyword值(预先设定好的正确密码)。若输入的密码正确,此时Check的值应为0,否则值不为0。
11号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_Check=0,score_Check_min=0] ~ ~ ~ scoreboard players set @a True 1
发现Enter值≥1,Check值=0的玩家后将玩家的True计分板设为1。
(此指令可以化简,也就是合并两个选择器,但为了更直观且与前后指令统一,我写成了这个样子)
12号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True_min=1] ~ ~ ~ /
发现Enter值≥1,True值≥1的玩家后执行预先设定的指令。
(同上指令,此指令可以化简)
13号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True_min=1] ~ ~ ~ title @a title {text:"密码正确!",color:green,bold:true}
发现Enter值≥1,True值≥1的玩家后在玩家屏幕中显示标题“密码正确!”,绿色加粗。
(同上指令,可以化简)
14号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ execute @a[score_True=0] ~ ~ ~ title @a title {text:"密码错误!",color:red,bold:true}
发现Enter值≥1,True值≤0的玩家后在玩家屏幕中显示标题“密码错误!”,红色加粗。
(同上指令,可以化简)
15号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a Check 0
发现Enter值≥1的玩家后将玩家的Check计分板设为0,初始化。
16号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a True 0
发现Enter值≥1的玩家后将玩家的True计分板设为0,初始化。
17号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard objectives setdisplay sidebar
发现Enter值≥1的玩家后清空玩家的侧边栏。
18号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ tellraw @a {text:"nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"}
发现Enter值≥1的玩家后在玩家的聊天栏内输出许多换行,简称清屏。
19号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set 输入 Number 0
发现Enter值≥1的玩家后将假名“输入”的Number值设为0,初始化。
20号命令方块:
/execute @a[score_Enter_min=1] ~ ~ ~ scoreboard players set @a Enter 0
发现Enter值≥1的玩家后将玩家的Enter值设为0。
最后来讲一下密码锁的数位。因为计分板能存储的最大数据为2147483647,所以低于这个数据的密码都是没问题的,依旧是9位以内的密码一定没问题。
PS:在此非常感谢我的世界玩家skeleton小白的分享。
以上就是命令方块数字密码锁制作教程及原理解析。更多精彩尽在游戏园我的世界专区。
最新热门攻略推荐:
精品推荐
相关文章
更多+热门搜索
手游排行榜
- 最新排行
- 最热排行
- 评分最高
-
休闲益智 大小:65M
-
飞行射击 大小:100M
-
模拟经营 大小:77.2MB
-
休闲益智 大小:120.24MB
-
应用软件 大小:709MB