我正在尝试为Minecraft生成一些代码(是的,我仍然在播放),我需要生成以下代码:
/summon villager ~ ~ ~ {Silent:1b,Invulnerable:1b,LeftHanded:0b,Leashed:0b,PersistenceRequired:1b,NoAI:0b,CanPickUpLoot:0b,VillagerData:{level:5,profession:"minecraft:cleric",type:"minecraft:snow"},Offers:{Recipes:[{maxUses:2147483647,priceMultiplier:1f,buy:{id:"minecraft:sunflower",Count:1b,tag:{display:{Name:"{\"text\":\"Trading Token\",\"color\":\"gold\",\"bold\":true}"},HideFlags:1,token:true,Enchantments:[{id:"minecraft:protection",lvl:0s}]}},sell:{id:"minecraft:coal",Count:1b}}]}}
但是,当我运行my program时,我最终会遇到以下问题:
/summon villager ~ ~ ~ {Silent:1b,Invulnerable:1b,LeftHanded:0b,Leashed:0b,PersistenceRequired:1b,NoAI:0b,CanPickUpLoot:0b,VillagerData:{level:5,profession:"minecraft:cleric",type:"minecraft:snow"},Offers:{Recipes:[{maxUses:2147483647,priceMultiplier:1f,buy:{id:"minecraft:sunflower",Count:1b,tag:{display:{Name:"{"text":"Trading Token","color":"gold","bold":true}"},HideFlags:1,token:true,Enchantments:[{id:"minecraft:protection",lvl:0s}]}},sell:{id:"minecraft:coal",Count:1b}}]}}
差异可能很难找到,但是已经从我的代码中删除了所有的反斜杠,有人知道我怎么能防止这种情况?
编辑:如果转到my program并运行它,则第一个输入类型为“ coal”,第二个输入类型为“ 1”,第三个输入类型为“ 1” >