本帖最后由 Vinogradov 于 2019-2-12 19:31 编辑
本来这个输入法不是在我填坑的计划中的,但是为了给下一个帖子提供输入的方法,就顺手撸了一个,水一帖。
这个输入法支持可见ascii字符(即ascii值在32~126范围中的字符),最长字符串长度可达600


P.S. 可以确定的是这个数据包里肯定有可以写得更好得地方(比如有些execute as我写得繁琐了),但我不准备修改了,懒。当然如果出了bug,还是有可能会修一下的。

一、使用方法:
1. 解压后将整个文件夹放入存档的./datapacks文件夹中,打开游戏,一次性地运行
  1. /function keyboard:init
复制代码

2. 按如下配方合成蝙蝠蛋:


3. 将蝙蝠蛋拿在手里,你会发现它变成了两个名字为开始输入的蛋,请不要将它们分开:
,并对地右键。(注意:请不要在物品栏放置贵重物品。)效果如下:


4. 每个胡萝卜钓竿对应了一个字符。使用滚轮浏览你需要输入的字符,当滚轮从最后一格继续向后滚动到第一格时,会自动切换到下一页。同理,当滚轮从第一格继续向前滚动到最后一格时,会自动切换到上一页。(注意由于是每tick检测一次,所以如果滚动过快的话会产生不翻页的情况,慢慢来即可。                                                                                                                           

5. 当你找到想输入的字符时,右键对应的胡萝卜钓竿,字符会出现在聊天框:
重复这个过程,即可得到字符串:    

6. 按q键删除字符,按f键结束输入。




二、主要原理:其实我是觉得实现没啥好多说的,,,能看懂原理的人基本上看了效果就能脑补出实现,看不懂实现的人也不会对原理感兴趣。

1. 字符串的内部实现
这里字符串是使用实体大阵实现的,方便按序号读取/写入字符对应的ascii值。具体地说:
首先我们召唤实体大阵(注意加tag),并在记分板Keyboard.Index中写入对应的序数,方便之后调用:
  1. summon armor_stand ~ 0 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"{"text":""}",Tags:["Keyboard","keyboard.char0"]}
  2. scoreboard players set @e[tag=keyboard.char0] Keyboard.Index 0
  3. summon armor_stand ~ 0 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"{"text":""}",Tags:["Keyboard","keyboard.char1"]}
  4. scoreboard players set @e[tag=keyboard.char1] Keyboard.Index 1

  5. ......

  6. summon armor_stand ~ 0 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"{"text":""}",Tags:["Keyboard","keyboard.char598"]}
  7. scoreboard players set @e[tag=keyboard.char598] Keyboard.Index 598
  8. summon armor_stand ~ 0 ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"{"text":""}",Tags:["Keyboard","keyboard.char599"]}
  9. scoreboard players set @e[tag=keyboard.char599] Keyboard.Index 599
复制代码
这里keyboard.charxxx的tag加得可能确实有点多余了,,,不过我懒得改了。同时,我们需要一个变量str_len用来记录该字符串数组的长度。

2. 显示
很显然,这是用胡萝卜钓竿做的,使用replaceitem把键盘给玩家:
  1. replaceitem entity @s container.0 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"空格"}", Lore:["Keyboard"]}} 1
  2. replaceitem entity @s container.1 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"!"}", Lore:["Keyboard"]}} 1
  3. replaceitem entity @s container.2 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"\\""}", Lore:["Keyboard"]}} 1
  4. replaceitem entity @s container.3 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"#"}", Lore:["Keyboard"]}} 1
  5. replaceitem entity @s container.4 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"$"}", Lore:["Keyboard"]}} 1
  6. replaceitem entity @s container.5 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"%"}", Lore:["Keyboard"]}} 1
  7. replaceitem entity @s container.6 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"&"}", Lore:["Keyboard"]}} 1
  8. replaceitem entity @s container.7 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"'"}", Lore:["Keyboard"]}} 1
  9. replaceitem entity @s container.8 minecraft:carrot_on_a_stick{Tags:["Keyboard.key"],display:{Name:"{"text":"("}", Lore:["Keyboard"]}} 1
复制代码
为了实现滚轮翻页,我们需要记录每tick玩家选中的位置,并与上一tick中的位置比较,用来判断是否需要翻页:
  1. execute as @a[nbt={SelectedItemSlot:0},scores={Keyboard.Enabled=1..}] run execute if score @s LastTickSlot matches 8 run function keyboard:display/next_frame
  2. execute as @a[nbt={SelectedItemSlot:8},scores={Keyboard.Enabled=1..}] run execute if score @s LastTickSlot matches 0 run function keyboard:display/previous_frame

  3. execute as @a[nbt={SelectedItemSlot:0},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 0
  4. execute as @a[nbt={SelectedItemSlot:1},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 1
  5. execute as @a[nbt={SelectedItemSlot:2},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 2
  6. execute as @a[nbt={SelectedItemSlot:3},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 3
  7. execute as @a[nbt={SelectedItemSlot:4},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 4
  8. execute as @a[nbt={SelectedItemSlot:5},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 5
  9. execute as @a[nbt={SelectedItemSlot:6},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 6
  10. execute as @a[nbt={SelectedItemSlot:7},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 7
  11. execute as @a[nbt={SelectedItemSlot:8},scores={Keyboard.Enabled=1..}] run scoreboard players set @s LastTickSlot 8
复制代码
翻页时,对当前页数进行穷举,决定接下来显示的页面:
  1. execute if score @s CurrentFrame matches 0 run function keyboard:display/show_frame1
  2. execute if score @s CurrentFrame matches 1 run function keyboard:display/show_frame2
  3. execute if score @s CurrentFrame matches 2 run function keyboard:display/show_frame3
  4. execute if score @s CurrentFrame matches 3 run function keyboard:display/show_frame4
  5. execute if score @s CurrentFrame matches 4 run function keyboard:display/show_frame5
  6. execute if score @s CurrentFrame matches 5 run function keyboard:display/show_frame6
  7. execute if score @s CurrentFrame matches 6 run function keyboard:display/show_frame7
  8. execute if score @s CurrentFrame matches 7 run function keyboard:display/show_frame8
  9. execute if score @s CurrentFrame matches 8 run function keyboard:display/show_frame9
  10. execute if score @s CurrentFrame matches 9 run function keyboard:display/show_frame10
  11. execute if score @s CurrentFrame matches 10 run function keyboard:display/show_frame0

  12. scoreboard players operation @s CurrentFrame += const12 CurrentFrame
  13. scoreboard players operation @s CurrentFrame %= const11 CurrentFrame
复制代码

3. 输入
对胡萝卜钓竿经行右键检测:
  1. scoreboard objectives add Keyboard.Pressed minecraft.used:minecraft.carrot_on_a_stick
复制代码
当检测到胡萝卜钓竿被右键时,判断玩家手持的胡萝卜钓竿对应哪个字符,并输入到字符串数组:
  1. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:"{"text":"空格"}"}}}}] run execute as @e[tag=Keyboard] run execute if score @s Keyboard.Index = str_len Keyboard.String run function keyboard:input/input_ascii32
  2. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:"{"text":"!"}"}}}}] run execute as @e[tag=Keyboard] run execute if score @s Keyboard.Index = str_len Keyboard.String run function keyboard:input/input_ascii33
  3. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:"{"text":"\\""}"}}}}] run execute as @e[tag=Keyboard] run execute if score @s Keyboard.Index = str_len Keyboard.String run function keyboard:input/input_ascii34

  4. ......


  5. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:"{"text":"}"}"}}}}] run execute as @e[tag=Keyboard] run execute if score @s Keyboard.Index = str_len Keyboard.String run function keyboard:input/input_ascii125
  6. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:"{"text":"~"}"}}}}] run execute as @e[tag=Keyboard] run execute if score @s Keyboard.Index = str_len Keyboard.String run function keyboard:input/input_ascii126

  7. execute if score str_len Keyboard.String matches 601 run scoreboard players remove str_len Keyboard.String 1
  8. execute as @a[scores={Keyboard.Enabled=1..,Keyboard.Pressed=1..}] run function keyboard:display/display_result
  9. scoreboard players set @a[scores={Keyboard.Pressed=1..}] Keyboard.Pressed 0
复制代码
注意:这里最后进行了边界检测,并将字符串的长度+1。
这里面keyboard:input/input_ascii32的实现如下:
  1. scoreboard players set @s Keyboard.String 32
  2. data merge entity @s {CustomName:"" ""}
  3. scoreboard players add str_len Keyboard.String 1
复制代码
q键删除的实现无非就是检测输入中的玩家主手是否为空然后对字符串数组经行操作,命令就不贴了。
类似地,f键结束输入地实现是检测输入中地玩家副手手否为空,这也很显然,这里就不说了。

4. 显示
这很简单,就是简单地tellraw(注意清屏):

  1. tellraw @s {"text":"\n\n\n\n\n\n\n\n\n "}
  2. tellraw @s [{"selector":"@e[tag=keyboard.char0]"},{"selector":"@e[tag=keyboard.char1]"},{"selector":"@e[tag=keyboard.char2]"},{"selector":"@e[tag=keyboard.char3]"},{"selector":"@e[tag=keyboard.char4]"},{"selector":"@e[tag=keyboard.char5]"},{"selector":"@e[tag=keyboard.char6]"},{"selector":"@e[tag=keyboard.char7]"},{"selector":"@e[tag=keyboard.char8]"},{"selector":"@e[tag=keyboard.char9]"},{"selector":"@e[tag=keyboard.char10]"},{"selector":"@e[tag=keyboard.char11]"},{"selector":"@e[tag=keyboard.char12]"},{"selector":"@e[tag=keyboard.char13]"},{"selector":"@e[tag=keyboard.char14]"},{"selector":"@e[tag=keyboard.char15]"},{"selector":"@e[tag=keyboard.char16]"},{"selector":"@e[tag=keyboard.char17]"},{"selector":"@e[tag=keyboard.char18]"},{"selector":"@e[tag=keyboard.char19]"},{"selector":"@e[tag=keyboard.char20]"},{"selector":"@e[tag=keyboard.char21]"},{"selector":"@e[tag=keyboard.char22]"},{"selector":"@e[tag=keyboard.char23]"},{"selector":"@e[tag=keyboard.char24]"},{"selector":"@e[tag=keyboard.char25]"},{"selector":"@e[tag=keyboard.char26]"},{"selector":"@e[tag=keyboard.char27]"},{"selector":"@e[tag=keyboard.char28]"},{"selector":"@e[tag=keyboard.char29]"},{"selector":"@e[tag=keyboard.char30]"},{"selector":"@e[tag=keyboard.char31]"},{"selector":"@e[tag=keyboard.char32]"},{"selector":"@e[tag=keyboard.char33]"},{"selector":"@e[tag=keyboard.char34]"},{"selector":"@e[tag=keyboard.char35]"},{"selector":"@e[tag=keyboard.char36]"},{"selector":"@e[tag=keyboard.char37]"},{"selector":"@e[tag=keyboard.char38]"},{"selector":"@e[tag=keyboard.char39]"},{"selector":"@e[tag=keyboard.char40]"},{"selector":"@e[tag=keyboard.char41]"},{"selector":"@e[tag=keyboard.char42]"},{"selector":"@e[tag=keyboard.char43]"},{"selector":"@e[tag=keyboard.char44]"},{"selector":"@e[tag=keyboard.char45]"},{"selector":"@e[tag=keyboard.char46]"},{"selector":"@e[tag=keyboard.char47]"},{"selector":"@e[tag=keyboard.char48]"},{"selector":"@e[tag=keyboard.char49]"},{"selector":"@e[tag=keyboard.char50]"},{"selector":"@e[tag=keyboard.char51]"},{"selector":"@e[tag=keyboard.char52]"},{"selector":"@e[tag=keyboard.char53]"},{"selector":"@e[tag=keyboard.char54]"},{"selector":"@e[tag=keyboard.char55]"},{"selector":"@e[tag=keyboard.char56]"},{"selector":"@e[tag=keyboard.char57]"},{"selector":"@e[tag=keyboard.char58]"},{"selector":"@e[tag=keyboard.char59]"},{"selector":"@e[tag=keyboard.char60]"},{"selector":"@e[tag=keyboard.char61]"},{"selector":"@e[tag=keyboard.char62]"},{"selector":"@e[tag=keyboard.char63]"},{"selector":"@e[tag=keyboard.char64]"},{"selector":"@e[tag=keyboard.char65]"},{"selector":"@e[tag=keyboard.char66]"},{"selector":"@e[tag=keyboard.char67]"},{"selector":"@e[tag=keyboard.char68]"},{"selector":"@e[tag=keyboard.char69]"},{"selector":"@e[tag=keyboard.char70]"},{"selector":"@e[tag=keyboard.char71]"},{"selector":"@e[tag=keyboard.char72]"},{"selector":"@e[tag=keyboard.char73]"},{"selector":"@e[tag=keyboard.char74]"},{"selector":"@e[tag=keyboard.char75]"},{"selector":"@e[tag=keyboard.char76]"},{"selector":"@e[tag=keyboard.char77]"},{"selector":"@e[tag=keyboard.char78]"},{"selector":"@e[tag=keyboard.char79]"},{"selector":"@e[tag=keyboard.char80]"},{"selector":"@e[tag=keyboard.char81]"},{"selector":"@e[tag=keyboard.char82]"},{"selector":"@e[tag=keyboard.char83]"},{"selector":"@e[tag=keyboard.char84]"},{"selector":"@e[tag=keyboard.char85]"},{"selector":"@e[tag=keyboard.char86]"},{"selector":"@e[tag=keyboard.char87]"},{"selector":"@e[tag=keyboard.char88]"},{"selector":"@e[tag=keyboard.char89]"},{"selector":"@e[tag=keyboard.char90]"},{"selector":"@e[tag=keyboard.char91]"},{"selector":"@e[tag=keyboard.char92]"},{"selector":"@e[tag=keyboard.char93]"},{"selector":"@e[tag=keyboard.char94]"},{"selector":"@e[tag=keyboard.char95]"},{"selector":"@e[tag=keyboard.char96]"},{"selector":"@e[tag=keyboard.char97]"},{"selector":"@e[tag=keyboard.char98]"},{"selector":"@e[tag=keyboard.char99]"},{"selector":"@e[tag=keyboard.char100]"},{"selector":"@e[tag=keyboard.char101]"},{"selector":"@e[tag=keyboard.char102]"},{"selector":"@e[tag=keyboard.char103]"},{"selector":"@e[tag=keyboard.char104]"},{"selector":"@e[tag=keyboard.char105]"},{"selector":"@e[tag=keyboard.char106]"},{"selector":"@e[tag=keyboard.char107]"},{"selector":"@e[tag=keyboard.char108]"},{"selector":"@e[tag=keyboard.char109]"},{"selector":"@e[tag=keyboard.char110]"},{"selector":"@e[tag=keyboard.char111]"},{"selector":"@e[tag=keyboard.char112]"},{"selector":"@e[tag=keyboard.char113]"},{"selector":"@e[tag=keyboard.char114]"},{"selector":"@e[tag=keyboard.char115]"},{"selector":"@e[tag=keyboard.char116]"},{"selector":"@e[tag=keyboard.char117]"},{"selector":"@e[tag=keyboard.char118]"},{"selector":"@e[tag=keyboard.char119]"},{"selector":"@e[tag=keyboard.char120]"},{"selector":"@e[tag=keyboard.char121]"},{"selector":"@e[tag=keyboard.char122]"},{"selector":"@e[tag=keyboard.char123]"},{"selector":"@e[tag=keyboard.char124]"},{"selector":"@e[tag=keyboard.char125]"},{"selector":"@e[tag=keyboard.char126]"},{"selector":"@e[tag=keyboard.char127]"},{"selector":"@e[tag=keyboard.char128]"},{"selector":"@e[tag=keyboard.char129]"},{"selector":"@e[tag=keyboard.char130]"},{"selector":"@e[tag=keyboard.char131]"},{"selector":"@e[tag=keyboard.char132]"},{"selector":"@e[tag=keyboard.char133]"},{"selector":"@e[tag=keyboard.char134]"},{"selector":"@e[tag=keyboard.char135]"},{"selector":"@e[tag=keyboard.char136]"},{"selector":"@e[tag=keyboard.char137]"},{"selector":"@e[tag=keyboard.char138]"},{"selector":"@e[tag=keyboard.char139]"},{"selector":"@e[tag=keyboard.char140]"},{"selector":"@e[tag=keyboard.char141]"},{"selector":"@e[tag=keyboard.char142]"},{"selector":"@e[tag=keyboard.char143]"},{"selector":"@e[tag=keyboard.char144]"},{"selector":"@e[tag=keyboard.char145]"},{"selector":"@e[tag=keyboard.char146]"},{"selector":"@e[tag=keyboard.char147]"},{"selector":"@e[tag=keyboard.char148]"},{"selector":"@e[tag=keyboard.char149]"},{"selector":"@e[tag=keyboard.char150]"},{"selector":"@e[tag=keyboard.char151]"},{"selector":"@e[tag=keyboard.char152]"},{"selector":"@e[tag=keyboard.char153]"},{"selector":"@e[tag=keyboard.char154]"},{"selector":"@e[tag=keyboard.char155]"},{"selector":"@e[tag=keyboard.char156]"},{"selector":"@e[tag=keyboard.char157]"},{"selector":"@e[tag=keyboard.char158]"},{"selector":"@e[tag=keyboard.char159]"},{"selector":"@e[tag=keyboard.char160]"},{"selector":"@e[tag=keyboard.char161]"},{"selector":"@e[tag=keyboard.char162]"},{"selector":"@e[tag=keyboard.char163]"},{"selector":"@e[tag=keyboard.char164]"},{"selector":"@e[tag=keyboard.char165]"},{"selector":"@e[tag=keyboard.char166]"},{"selector":"@e[tag=keyboard.char167]"},{"selector":"@e[tag=keyboard.char168]"},{"selector":"@e[tag=keyboard.char169]"},{"selector":"@e[tag=keyboard.char170]"},{"selector":"@e[tag=keyboard.char171]"},{"selector":"@e[tag=keyboard.char172]"},{"selector":"@e[tag=keyboard.char173]"},{"selector":"@e[tag=keyboard.char174]"},{"selector":"@e[tag=keyboard.char175]"},{"selector":"@e[tag=keyboard.char176]"},{"selector":"@e[tag=keyboard.char177]"},{"selector":"@e[tag=keyboard.char178]"},{"selector":"@e[tag=keyboard.char179]"},{"selector":"@e[tag=keyboard.char180]"},{"selector":"@e[tag=keyboard.char181]"},{"selector":"@e[tag=keyboard.char182]"},{"selector":"@e[tag=keyboard.char183]"},{"selector":"@e[tag=keyboard.char184]"},{"selector":"@e[tag=keyboard.char185]"},{"selector":"@e[tag=keyboard.char186]"},{"selector":"@e[tag=keyboard.char187]"},{"selector":"@e[tag=keyboard.char188]"},{"selector":"@e[tag=keyboard.char189]"},{"selector":"@e[tag=keyboard.char190]"},{"selector":"@e[tag=keyboard.char191]"},{"selector":"@e[tag=keyboard.char192]"},{"selector":"@e[tag=keyboard.char193]"},{"selector":"@e[tag=keyboard.char194]"},{"selector":"@e[tag=keyboard.char195]"},{"selector":"@e[tag=keyboard.char196]"},{"selector":"@e[tag=keyboard.char197]"},{"selector":"@e[tag=keyboard.char198]"},{"selector":"@e[tag=keyboard.char199]"},{"selector":"@e[tag=keyboard.char200]"},{"selector":"@e[tag=keyboard.char201]"},{"selector":"@e[tag=keyboard.char202]"},{"selector":"@e[tag=keyboard.char203]"},{"selector":"@e[tag=keyboard.char204]"},{"selector":"@e[tag=keyboard.char205]"},{"selector":"@e[tag=keyboard.char206]"},{"selector":"@e[tag=keyboard.char207]"},{"selector":"@e[tag=keyboard.char208]"},{"selector":"@e[tag=keyboard.char209]"},{"selector":"@e[tag=keyboard.char210]"},{"selector":"@e[tag=keyboard.char211]"},{"selector":"@e[tag=keyboard.char212]"},{"selector":"@e[tag=keyboard.char213]"},{"selector":"@e[tag=keyboard.char214]"},{"selector":"@e[tag=keyboard.char215]"},{"selector":"@e[tag=keyboard.char216]"},{"selector":"@e[tag=keyboard.char217]"},{"selector":"@e[tag=keyboard.char218]"},{"selector":"@e[tag=keyboard.char219]"},{"selector":"@e[tag=keyboard.char220]"},{"selector":"@e[tag=keyboard.char221]"},{"selector":"@e[tag=keyboard.char222]"},{"selector":"@e[tag=keyboard.char223]"},{"selector":"@e[tag=keyboard.char224]"},{"selector":"@e[tag=keyboard.char225]"},{"selector":"@e[tag=keyboard.char226]"},{"selector":"@e[tag=keyboard.char227]"},{"selector":"@e[tag=keyboard.char228]"},{"selector":"@e[tag=keyboard.char229]"},{"selector":"@e[tag=keyboard.char230]"},{"selector":"@e[tag=keyboard.char231]"},{"selector":"@e[tag=keyboard.char232]"},{"selector":"@e[tag=keyboard.char233]"},{"selector":"@e[tag=keyboard.char234]"},{"selector":"@e[tag=keyboard.char235]"},{"selector":"@e[tag=keyboard.char236]"},{"selector":"@e[tag=keyboard.char237]"},{"selector":"@e[tag=keyboard.char238]"},{"selector":"@e[tag=keyboard.char239]"},{"selector":"@e[tag=keyboard.char240]"},{"selector":"@e[tag=keyboard.char241]"},{"selector":"@e[tag=keyboard.char242]"},{"selector":"@e[tag=keyboard.char243]"},{"selector":"@e[tag=keyboard.char244]"},{"selector":"@e[tag=keyboard.char245]"},{"selector":"@e[tag=keyboard.char246]"},{"selector":"@e[tag=keyboard.char247]"},{"selector":"@e[tag=keyboard.char248]"},{"selector":"@e[tag=keyboard.char249]"},{"selector":"@e[tag=keyboard.char250]"},{"selector":"@e[tag=keyboard.char251]"},{"selector":"@e[tag=keyboard.char252]"},{"selector":"@e[tag=keyboard.char253]"},{"selector":"@e[tag=keyboard.char254]"},{"selector":"@e[tag=keyboard.char255]"},{"selector":"@e[tag=keyboard.char256]"},{"selector":"@e[tag=keyboard.char257]"},{"selector":"@e[tag=keyboard.char258]"},{"selector":"@e[tag=keyboard.char259]"},{"selector":"@e[tag=keyboard.char260]"},{"selector":"@e[tag=keyboard.char261]"},{"selector":"@e[tag=keyboard.char262]"},{"selector":"@e[tag=keyboard.char263]"},{"selector":"@e[tag=keyboard.char264]"},{"selector":"@e[tag=keyboard.char265]"},{"selector":"@e[tag=keyboard.char266]"},{"selector":"@e[tag=keyboard.char267]"},{"selector":"@e[tag=keyboard.char268]"},{"selector":"@e[tag=keyboard.char269]"},{"selector":"@e[tag=keyboard.char270]"},{"selector":"@e[tag=keyboard.char271]"},{"selector":"@e[tag=keyboard.char272]"},{"selector":"@e[tag=keyboard.char273]"},{"selector":"@e[tag=keyboard.char274]"},{"selector":"@e[tag=keyboard.char275]"},{"selector":"@e[tag=keyboard.char276]"},{"selector":"@e[tag=keyboard.char277]"},{"selector":"@e[tag=keyboard.char278]"},{"selector":"@e[tag=keyboard.char279]"},{"selector":"@e[tag=keyboard.char280]"},{"selector":"@e[tag=keyboard.char281]"},{"selector":"@e[tag=keyboard.char282]"},{"selector":"@e[tag=keyboard.char283]"},{"selector":"@e[tag=keyboard.char284]"},{"selector":"@e[tag=keyboard.char285]"},{"selector":"@e[tag=keyboard.char286]"},{"selector":"@e[tag=keyboard.char287]"},{"selector":"@e[tag=keyboard.char288]"},{"selector":"@e[tag=keyboard.char289]"},{"selector":"@e[tag=keyboard.char290]"},{"selector":"@e[tag=keyboard.char291]"},{"selector":"@e[tag=keyboard.char292]"},{"selector":"@e[tag=keyboard.char293]"},{"selector":"@e[tag=keyboard.char294]"},{"selector":"@e[tag=keyboard.char295]"},{"selector":"@e[tag=keyboard.char296]"},{"selector":"@e[tag=keyboard.char297]"},{"selector":"@e[tag=keyboard.char298]"},{"selector":"@e[tag=keyboard.char299]"},{"selector":"@e[tag=keyboard.char300]"},{"selector":"@e[tag=keyboard.char301]"},{"selector":"@e[tag=keyboard.char302]"},{"selector":"@e[tag=keyboard.char303]"},{"selector":"@e[tag=keyboard.char304]"},{"selector":"@e[tag=keyboard.char305]"},{"selector":"@e[tag=keyboard.char306]"},{"selector":"@e[tag=keyboard.char307]"},{"selector":"@e[tag=keyboard.char308]"},{"selector":"@e[tag=keyboard.char309]"},{"selector":"@e[tag=keyboard.char310]"},{"selector":"@e[tag=keyboard.char311]"},{"selector":"@e[tag=keyboard.char312]"},{"selector":"@e[tag=keyboard.char313]"},{"selector":"@e[tag=keyboard.char314]"},{"selector":"@e[tag=keyboard.char315]"},{"selector":"@e[tag=keyboard.char316]"},{"selector":"@e[tag=keyboard.char317]"},{"selector":"@e[tag=keyboard.char318]"},{"selector":"@e[tag=keyboard.char319]"},{"selector":"@e[tag=keyboard.char320]"},{"selector":"@e[tag=keyboard.char321]"},{"selector":"@e[tag=keyboard.char322]"},{"selector":"@e[tag=keyboard.char323]"},{"selector":"@e[tag=keyboard.char324]"},{"selector":"@e[tag=keyboard.char325]"},{"selector":"@e[tag=keyboard.char326]"},{"selector":"@e[tag=keyboard.char327]"},{"selector":"@e[tag=keyboard.char328]"},{"selector":"@e[tag=keyboard.char329]"},{"selector":"@e[tag=keyboard.char330]"},{"selector":"@e[tag=keyboard.char331]"},{"selector":"@e[tag=keyboard.char332]"},{"selector":"@e[tag=keyboard.char333]"},{"selector":"@e[tag=keyboard.char334]"},{"selector":"@e[tag=keyboard.char335]"},{"selector":"@e[tag=keyboard.char336]"},{"selector":"@e[tag=keyboard.char337]"},{"selector":"@e[tag=keyboard.char338]"},{"selector":"@e[tag=keyboard.char339]"},{"selector":"@e[tag=keyboard.char340]"},{"selector":"@e[tag=keyboard.char341]"},{"selector":"@e[tag=keyboard.char342]"},{"selector":"@e[tag=keyboard.char343]"},{"selector":"@e[tag=keyboard.char344]"},{"selector":"@e[tag=keyboard.char345]"},{"selector":"@e[tag=keyboard.char346]"},{"selector":"@e[tag=keyboard.char347]"},{"selector":"@e[tag=keyboard.char348]"},{"selector":"@e[tag=keyboard.char349]"},{"selector":"@e[tag=keyboard.char350]"},{"selector":"@e[tag=keyboard.char351]"},{"selector":"@e[tag=keyboard.char352]"},{"selector":"@e[tag=keyboard.char353]"},{"selector":"@e[tag=keyboard.char354]"},{"selector":"@e[tag=keyboard.char355]"},{"selector":"@e[tag=keyboard.char356]"},{"selector":"@e[tag=keyboard.char357]"},{"selector":"@e[tag=keyboard.char358]"},{"selector":"@e[tag=keyboard.char359]"},{"selector":"@e[tag=keyboard.char360]"},{"selector":"@e[tag=keyboard.char361]"},{"selector":"@e[tag=keyboard.char362]"},{"selector":"@e[tag=keyboard.char363]"},{"selector":"@e[tag=keyboard.char364]"},{"selector":"@e[tag=keyboard.char365]"},{"selector":"@e[tag=keyboard.char366]"},{"selector":"@e[tag=keyboard.char367]"},{"selector":"@e[tag=keyboard.char368]"},{"selector":"@e[tag=keyboard.char369]"},{"selector":"@e[tag=keyboard.char370]"},{"selector":"@e[tag=keyboard.char371]"},{"selector":"@e[tag=keyboard.char372]"},{"selector":"@e[tag=keyboard.char373]"},{"selector":"@e[tag=keyboard.char374]"},{"selector":"@e[tag=keyboard.char375]"},{"selector":"@e[tag=keyboard.char376]"},{"selector":"@e[tag=keyboard.char377]"},{"selector":"@e[tag=keyboard.char378]"},{"selector":"@e[tag=keyboard.char379]"},{"selector":"@e[tag=keyboard.char380]"},{"selector":"@e[tag=keyboard.char381]"},{"selector":"@e[tag=keyboard.char382]"},{"selector":"@e[tag=keyboard.char383]"},{"selector":"@e[tag=keyboard.char384]"},{"selector":"@e[tag=keyboard.char385]"},{"selector":"@e[tag=keyboard.char386]"},{"selector":"@e[tag=keyboard.char387]"},{"selector":"@e[tag=keyboard.char388]"},{"selector":"@e[tag=keyboard.char389]"},{"selector":"@e[tag=keyboard.char390]"},{"selector":"@e[tag=keyboard.char391]"},{"selector":"@e[tag=keyboard.char392]"},{"selector":"@e[tag=keyboard.char393]"},{"selector":"@e[tag=keyboard.char394]"},{"selector":"@e[tag=keyboard.char395]"},{"selector":"@e[tag=keyboard.char396]"},{"selector":"@e[tag=keyboard.char397]"},{"selector":"@e[tag=keyboard.char398]"},{"selector":"@e[tag=keyboard.char399]"},{"selector":"@e[tag=keyboard.char400]"},{"selector":"@e[tag=keyboard.char401]"},{"selector":"@e[tag=keyboard.char402]"},{"selector":"@e[tag=keyboard.char403]"},{"selector":"@e[tag=keyboard.char404]"},{"selector":"@e[tag=keyboard.char405]"},{"selector":"@e[tag=keyboard.char406]"},{"selector":"@e[tag=keyboard.char407]"},{"selector":"@e[tag=keyboard.char408]"},{"selector":"@e[tag=keyboard.char409]"},{"selector":"@e[tag=keyboard.char410]"},{"selector":"@e[tag=keyboard.char411]"},{"selector":"@e[tag=keyboard.char412]"},{"selector":"@e[tag=keyboard.char413]"},{"selector":"@e[tag=keyboard.char414]"},{"selector":"@e[tag=keyboard.char415]"},{"selector":"@e[tag=keyboard.char416]"},{"selector":"@e[tag=keyboard.char417]"},{"selector":"@e[tag=keyboard.char418]"},{"selector":"@e[tag=keyboard.char419]"},{"selector":"@e[tag=keyboard.char420]"},{"selector":"@e[tag=keyboard.char421]"},{"selector":"@e[tag=keyboard.char422]"},{"selector":"@e[tag=keyboard.char423]"},{"selector":"@e[tag=keyboard.char424]"},{"selector":"@e[tag=keyboard.char425]"},{"selector":"@e[tag=keyboard.char426]"},{"selector":"@e[tag=keyboard.char427]"},{"selector":"@e[tag=keyboard.char428]"},{"selector":"@e[tag=keyboard.char429]"},{"selector":"@e[tag=keyboard.char430]"},{"selector":"@e[tag=keyboard.char431]"},{"selector":"@e[tag=keyboard.char432]"},{"selector":"@e[tag=keyboard.char433]"},{"selector":"@e[tag=keyboard.char434]"},{"selector":"@e[tag=keyboard.char435]"},{"selector":"@e[tag=keyboard.char436]"},{"selector":"@e[tag=keyboard.char437]"},{"selector":"@e[tag=keyboard.char438]"},{"selector":"@e[tag=keyboard.char439]"},{"selector":"@e[tag=keyboard.char440]"},{"selector":"@e[tag=keyboard.char441]"},{"selector":"@e[tag=keyboard.char442]"},{"selector":"@e[tag=keyboard.char443]"},{"selector":"@e[tag=keyboard.char444]"},{"selector":"@e[tag=keyboard.char445]"},{"selector":"@e[tag=keyboard.char446]"},{"selector":"@e[tag=keyboard.char447]"},{"selector":"@e[tag=keyboard.char448]"},{"selector":"@e[tag=keyboard.char449]"},{"selector":"@e[tag=keyboard.char450]"},{"selector":"@e[tag=keyboard.char451]"},{"selector":"@e[tag=keyboard.char452]"},{"selector":"@e[tag=keyboard.char453]"},{"selector":"@e[tag=keyboard.char454]"},{"selector":"@e[tag=keyboard.char455]"},{"selector":"@e[tag=keyboard.char456]"},{"selector":"@e[tag=keyboard.char457]"},{"selector":"@e[tag=keyboard.char458]"},{"selector":"@e[tag=keyboard.char459]"},{"selector":"@e[tag=keyboard.char460]"},{"selector":"@e[tag=keyboard.char461]"},{"selector":"@e[tag=keyboard.char462]"},{"selector":"@e[tag=keyboard.char463]"},{"selector":"@e[tag=keyboard.char464]"},{"selector":"@e[tag=keyboard.char465]"},{"selector":"@e[tag=keyboard.char466]"},{"selector":"@e[tag=keyboard.char467]"},{"selector":"@e[tag=keyboard.char468]"},{"selector":"@e[tag=keyboard.char469]"},{"selector":"@e[tag=keyboard.char470]"},{"selector":"@e[tag=keyboard.char471]"},{"selector":"@e[tag=keyboard.char472]"},{"selector":"@e[tag=keyboard.char473]"},{"selector":"@e[tag=keyboard.char474]"},{"selector":"@e[tag=keyboard.char475]"},{"selector":"@e[tag=keyboard.char476]"},{"selector":"@e[tag=keyboard.char477]"},{"selector":"@e[tag=keyboard.char478]"},{"selector":"@e[tag=keyboard.char479]"},{"selector":"@e[tag=keyboard.char480]"},{"selector":"@e[tag=keyboard.char481]"},{"selector":"@e[tag=keyboard.char482]"},{"selector":"@e[tag=keyboard.char483]"},{"selector":"@e[tag=keyboard.char484]"},{"selector":"@e[tag=keyboard.char485]"},{"selector":"@e[tag=keyboard.char486]"},{"selector":"@e[tag=keyboard.char487]"},{"selector":"@e[tag=keyboard.char488]"},{"selector":"@e[tag=keyboard.char489]"},{"selector":"@e[tag=keyboard.char490]"},{"selector":"@e[tag=keyboard.char491]"},{"selector":"@e[tag=keyboard.char492]"},{"selector":"@e[tag=keyboard.char493]"},{"selector":"@e[tag=keyboard.char494]"},{"selector":"@e[tag=keyboard.char495]"},{"selector":"@e[tag=keyboard.char496]"},{"selector":"@e[tag=keyboard.char497]"},{"selector":"@e[tag=keyboard.char498]"},{"selector":"@e[tag=keyboard.char499]"},{"selector":"@e[tag=keyboard.char500]"},{"selector":"@e[tag=keyboard.char501]"},{"selector":"@e[tag=keyboard.char502]"},{"selector":"@e[tag=keyboard.char503]"},{"selector":"@e[tag=keyboard.char504]"},{"selector":"@e[tag=keyboard.char505]"},{"selector":"@e[tag=keyboard.char506]"},{"selector":"@e[tag=keyboard.char507]"},{"selector":"@e[tag=keyboard.char508]"},{"selector":"@e[tag=keyboard.char509]"},{"selector":"@e[tag=keyboard.char510]"},{"selector":"@e[tag=keyboard.char511]"},{"selector":"@e[tag=keyboard.char512]"},{"selector":"@e[tag=keyboard.char513]"},{"selector":"@e[tag=keyboard.char514]"},{"selector":"@e[tag=keyboard.char515]"},{"selector":"@e[tag=keyboard.char516]"},{"selector":"@e[tag=keyboard.char517]"},{"selector":"@e[tag=keyboard.char518]"},{"selector":"@e[tag=keyboard.char519]"},{"selector":"@e[tag=keyboard.char520]"},{"selector":"@e[tag=keyboard.char521]"},{"selector":"@e[tag=keyboard.char522]"},{"selector":"@e[tag=keyboard.char523]"},{"selector":"@e[tag=keyboard.char524]"},{"selector":"@e[tag=keyboard.char525]"},{"selector":"@e[tag=keyboard.char526]"},{"selector":"@e[tag=keyboard.char527]"},{"selector":"@e[tag=keyboard.char528]"},{"selector":"@e[tag=keyboard.char529]"},{"selector":"@e[tag=keyboard.char530]"},{"selector":"@e[tag=keyboard.char531]"},{"selector":"@e[tag=keyboard.char532]"},{"selector":"@e[tag=keyboard.char533]"},{"selector":"@e[tag=keyboard.char534]"},{"selector":"@e[tag=keyboard.char535]"},{"selector":"@e[tag=keyboard.char536]"},{"selector":"@e[tag=keyboard.char537]"},{"selector":"@e[tag=keyboard.char538]"},{"selector":"@e[tag=keyboard.char539]"},{"selector":"@e[tag=keyboard.char540]"},{"selector":"@e[tag=keyboard.char541]"},{"selector":"@e[tag=keyboard.char542]"},{"selector":"@e[tag=keyboard.char543]"},{"selector":"@e[tag=keyboard.char544]"},{"selector":"@e[tag=keyboard.char545]"},{"selector":"@e[tag=keyboard.char546]"},{"selector":"@e[tag=keyboard.char547]"},{"selector":"@e[tag=keyboard.char548]"},{"selector":"@e[tag=keyboard.char549]"},{"selector":"@e[tag=keyboard.char550]"},{"selector":"@e[tag=keyboard.char551]"},{"selector":"@e[tag=keyboard.char552]"},{"selector":"@e[tag=keyboard.char553]"},{"selector":"@e[tag=keyboard.char554]"},{"selector":"@e[tag=keyboard.char555]"},{"selector":"@e[tag=keyboard.char556]"},{"selector":"@e[tag=keyboard.char557]"},{"selector":"@e[tag=keyboard.char558]"},{"selector":"@e[tag=keyboard.char559]"},{"selector":"@e[tag=keyboard.char560]"},{"selector":"@e[tag=keyboard.char561]"},{"selector":"@e[tag=keyboard.char562]"},{"selector":"@e[tag=keyboard.char563]"},{"selector":"@e[tag=keyboard.char564]"},{"selector":"@e[tag=keyboard.char565]"},{"selector":"@e[tag=keyboard.char566]"},{"selector":"@e[tag=keyboard.char567]"},{"selector":"@e[tag=keyboard.char568]"},{"selector":"@e[tag=keyboard.char569]"},{"selector":"@e[tag=keyboard.char570]"},{"selector":"@e[tag=keyboard.char571]"},{"selector":"@e[tag=keyboard.char572]"},{"selector":"@e[tag=keyboard.char573]"},{"selector":"@e[tag=keyboard.char574]"},{"selector":"@e[tag=keyboard.char575]"},{"selector":"@e[tag=keyboard.char576]"},{"selector":"@e[tag=keyboard.char577]"},{"selector":"@e[tag=keyboard.char578]"},{"selector":"@e[tag=keyboard.char579]"},{"selector":"@e[tag=keyboard.char580]"},{"selector":"@e[tag=keyboard.char581]"},{"selector":"@e[tag=keyboard.char582]"},{"selector":"@e[tag=keyboard.char583]"},{"selector":"@e[tag=keyboard.char584]"},{"selector":"@e[tag=keyboard.char585]"},{"selector":"@e[tag=keyboard.char586]"},{"selector":"@e[tag=keyboard.char587]"},{"selector":"@e[tag=keyboard.char588]"},{"selector":"@e[tag=keyboard.char589]"},{"selector":"@e[tag=keyboard.char590]"},{"selector":"@e[tag=keyboard.char591]"},{"selector":"@e[tag=keyboard.char592]"},{"selector":"@e[tag=keyboard.char593]"},{"selector":"@e[tag=keyboard.char594]"},{"selector":"@e[tag=keyboard.char595]"},{"selector":"@e[tag=keyboard.char596]"},{"selector":"@e[tag=keyboard.char597]"},{"selector":"@e[tag=keyboard.char598]"},{"selector":"@e[tag=keyboard.char599]"}]
复制代码

5. 其他关于刷怪蛋,由于原版的合成没法带nbt,所以只能先合成蝙蝠刷怪蛋再替换成我所需要的魔改刷怪蛋。由于偷懒(咕咕咕)的原因,我只检测了玩家拿在手里的情况。而由于mjsb的原因(——《ruhuasiyu语录》),生存模式下刷怪蛋的使用检测有点问题,手持两个或以上就可以避免,所以会出现两个“开始输入”刷怪蛋的情况,这是刻意为之。


别的就没有什么要说的了,感兴趣的看客可以拆包查看。

三、后记:
这个输入法对除了我以外的人应该都没啥用,而且从输入方式上来说远不如 @乙烯_中国 所做的中文输入法。滚轮翻页的方式显然是不方便的,字符多了以后找起来很麻烦,所以大家看看就行,不用当真。

做这个东西的初衷当然是为了给下一个帖子提供输入(至于下一个帖子的具体内容是什么,这里先卖个关子),然后做着做着学到了很多之前不会的东西(之前就不会多少东西),感觉也挺好的。


四、感谢:
@ruhuasiyu 这个输入法就是他给我的创意。在我填坑的过程中,如花教了我许多东西(比如怎么右键检测,怎么检测玩家主手/副手上的东西,等)。没有ruhuasiyu的帮助,这个输入法是不会存在的。

@玄素 给了我一些命令上的帮助。

@SPGoding 他的SPU帮我解决了一些问题,同时在他的帮助下(某种意义上)解决了刷怪蛋合成的bug。






















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

keyboard.zip

51.6 KB, 下载次数: 6