本帖最后由 chyx 于 2015-5-19 01:40 编辑 此贴只是讲解 算法是赶出来的 有许多地方可以改进





首先 这里是切换两个fillclock的地方
下面是标配的
  1. summon FallingSand ~ ~.5 ~ {Block:redstone_block}
复制代码
*2
左侧是指示灯
  1. /replaceitem entity @e[name=Timer] slot.armor.head minecraft:wool 1 5
复制代码
*2
上面是支持展示框用的
  1. execute @e[name=Use] ~ ~ ~ /fill ~ ~ ~ ~ ~ ~-1 minecraft:piston_extension
复制代码
*2

右侧是fill
  1. /fill 108 19 -574 108 19 -518 minecraft:redstone_block 0 destroy
复制代码








这里是面板
  1. /scoreboard players remove Timer timemax 1
  2. /scoreboard players add Timer timemax 1
复制代码
按钮的指令 负责加减时间间隔


显示器的指令:
  1. /blockdata 105 16 -570 {Text1:"时间间隔",Text2:"["",{"score":{"name":"Timer","objective":"timemax"},"color":"white","bold":"true"}]"}
复制代码
按两个按钮都会激活它


fillclock#1

先检测框内物品(做的时候安不上Map It)
  1. /scoreboard players set @e[name=Use] b 0
  2. /scoreboard players set @e[name=Use] b 1 {Item:{id:"minecraft:coal_block"}}
复制代码
检测是否右键
  1. /scoreboard players set @e[name=Use] tur 1
  2. /scoreboard players set @e[name=Use] tur 0 {ItemRotation:0b}
复制代码

然后是拓展,显示部分 最后讲


fillclock#2
先摆正所有的框
  1. entitydata @e[name=Use] {ItemRotation:0b,Invulnerable:1b}
复制代码
然后是可控制频率时钟
  1. /scoreboard players operation @e[name=Timer] time = Timer time
  2. /execute @e[name=Timer,score_time=0] ~ ~ ~ /fill 110 19 -569 110 19 -500 minecraft:redstone_block 0 destroy
  3. /execute @e[name=Timer,score_time=0] ~ ~ ~ /scoreboard players operation Timer time = Timer timemax
  4. /scoreboard players remove Timer time 1

复制代码
不要问我为何写的这么恶心 问mojang 因为计分板的一个bug才不得已这么写的



低频时钟

正片开始
先置零
  1. /scoreboard players set @e[name=Use] near 0
复制代码
8*
  1. /execute @e[score_b=0] ~ ~1 ~ /scoreboard players add @e[r=0,c=1,name=Use] near 1
复制代码

游戏规则:
  1. /scoreboard players set @e[name=Use] tur 0
  2. /scoreboard players set @e[name=Use,score_b_min=1,score_near_min=3,score_near=3] tur 1
  3. /scoreboard players set @e[name=Use,score_b=0,score_near_min=0,score_near=1] tur 1
复制代码
tur表示要变化

然后又是拓展,显示部分 clone过来

拓展,显示部分
隐藏内容重复8次 对应各个方向

切换黑白状态
b=(b-1)^2 很科学
  1. /scoreboard players remove @e[score_tur_min=1,name=Use] b 1
复制代码
  1. execute @e[score_tur_min=1] ~ ~ ~ /scoreboard players operation @e[c=1,r=0,name=Use] b *= @e[c=1,r=0,name=Use] b
复制代码


最后修改显示
  1. entitydata @e[score_b_min=1] {ItemRotation:0b,Invulnerable:1b,Item:{id:"minecraft:coal_block",Count:1b,Damage:0s}}
复制代码
  1. entitydata @e[score_b=0] {ItemRotation:0b,Invulnerable:1b,Item:{id:"minecraft:wool",Count:1b,Damage:0s}}
复制代码



新版本已做好http://pan.baidu.com/s/1c0yGwNI*将羊毛和煤块换成地图*增加装饰性屏风 一面是滑翔机图案 一面是cbl logo




[groupid=546]Command Block Logic[/groupid]