import json
key={"A":"","B":"","C":"","D":"","E":"","F":"","G":"","I":"","J":""}
x,y,z=0,int(1),0
craft={"type":"minecraft:crafting_shaped","pattern":["ABC","DEF","GIJ"],"key":key,"result":{"item":""}}
while y!=9:
print("使用时,将会不断的覆盖掉本文件的文件夹中的craft.json文件,请输入产物后立刻处理该文件。合成表元素顺序为从左到右,再从上到下,和MC百科添加合成表的AD快捷键类似")
for x in key:
print("请输入合成表的第",y,"个元素")
key[x]=input()
y=y+1
print("请输入合成表产物(1个),输入完成后将会覆盖掉原本的craft.json文件")
craft["result"]=input()
print("预览:",craft)
with open('craft.json', 'w', encoding='utf-8') as f:
json.dump(craft,f, ensure_ascii=False,indent=8)
y=1
#{"type":"minecraft:crafting_shaped","pattern":["ABC","DEF","GIJ"],"key":{"A":"","B":"","C":"","D":"","E":"","F":"","G":"","I":"","J":""},"result":{"item":""}}