【问题标题】:did not find expected key (line 93, column 9), context while parsing a block mapping (line 84, column 9)"解析块映射时未找到预期的键(第 93 行,第 9 列),上下文(第 84 行,第 9 列)"
【发布时间】:2020-06-01 14:27:57
【问题描述】:

我拥有一个 Minecraft Bedrock PocketMine-MP 服务器,今天我开始制作板条箱,我在控制台中查看以确保没有任何问题,但我看到了这个错误:

did not find expected key (line 93, column 9), context while parsing a 
 block mapping (line 84, column 9)"

我不知道这个文件有什么问题,但我希望我会尽快解决它。谢谢 我的 Crates.yml 文件是:

crates:
  Common:
    drops:
      - id: 339
        meta: 0
        amount: 1
        chance: 20
        name: "5000$"
        type: command
        commands:
         - "givemoney {PLAYER} 5000"
         - "Say §e{PLAYER} Just Won §25000$§e From A Common Crate!"
      - id: 131
        meta: 0
        amount: 1
        chance: 12
        name: "Common Key"
        type: command
        commands:
         - "key Common 1 {PLAYER}"
         - "Say §e{PLAYER} Just Won a §2Common Crate Key §eFrom a Common Crate!"
      - id: 304
        meta: 0
        amount: 1
        chance: 50
        commands:
         - "Say §e{PLAYER} Just Won a §2Chainmail Leggings §eFrom a Common Crate!"
    amount: 1
    floating-text: "Common Crate"
  Uncommon:
    drops:
      - id: 307
        meta: 0
        amount: 1
        chance: 20
        commands:
         - "Say §e{PLAYER} Just Won a §2Iron Chestplate §eFrom a Uncommon Crate!"
      - id: 131
        meta: 0
        amount: 2
        chance: 15
        name: "2 Common Keys"
        type: command
        commands:
         - "Say §e{PLAYER} Just Won§2 2 Common Keys §eFrom a Uncommon Crate!"
         - "Key Common 2 {PLAYER}"
      - id: 339
        meta: 0
        amount: 1
        chance: 30
        name: "20000$"
        type: command
        commands:
         - "Say §e{PLAYER} Just Won §220000 $§e From a Uncommon Crate!"
         - "givemoney {PLAYER} 20000"
      - id: 373
        meta: 30
        amount: 3
        chance: 10
        commands:
         - "Say {PLAYER} Just Won §22 Regeneration Potion II For 22 Seconds §eFrom a Uncommon Crate"
      - id: 438
        meta: 36
        amount: 1
        chance: 10
        commands:
         - "Say {PLAYER} Just Won a §2Splash Winter II Potion For 30 Seconds§e From A Uncommon Crate!"
    amount: 1
    floating-text: "Uncommon Crate"
  Vote:
    drops:
      - id: 368
        meta: 0
        amount: 4
        chance: 35
        commands:
         - "Say §e{PLAYER} Just Won§2 4 Ender Pearls §eFrom a Vote Crate!"
      - id: 322
        meta: 0
        amount: 2
        chance: 15
        commands:
         - "Say §e{PLAYER} Just Won 2 Golden Apples From a Vote Crate!"
      - id: 276
        meta: 0
        amount: 1
        chance: 50
        enchantments:
         - name: "Sharpness"
           level: 1
        commands:
         - "Say §e{PLAYER} Just Won a §2Diamond Sword With Sharpness 1 §2From a Vote Crate!"
        - id: 311
          meta: 0
          amount: 1
          chance: 9
          enchantments:
           - name: "Protection"
             level: 1
          commands:
           - "Say §e{PLAYER} Just Won §2Diamond Leggings With Protection 2§e From a Vote Crate!"
       - id: 438
         meta: 12
         amount: 3
         chance: 25
         commands:
          - "Say §e{PLAYER} Just Won §23 Fire Resistance Splash Potions §eFrom a Vote Crate!"
       - id: 339
         meta: 0
         amount: 1
         chance: 40
         name: "250000 $"
         type: command
         commands:
          - "givemoney {PLAYER} 25000"
          - "Say §e{PLAYER} Just Won §225000 $§e From A Vote Crate!"
    amount: 1
    floating-text: "Vote Crate"
  Mythic:
    drops:
      - id: 264
        meta: 0
        amount: 16
        chance: 35
      - id: 388
        meta: 0
        amount: 16
        chance: 15
      - id: 322
        meta: 0
        amount: 16
        chance: 50
    amount: 1
    commands: ["say {PLAYER} has opened an Mythic Crate"]
    floating-text: "Mythic Crate"
  Legendary:
    drops:
      - id: 278
        meta: 0
        amount: 1
        chance: 10
        name: "Telepathic Pickaxe"
        lore: "Items mined are transported into your inventory"
        enchantments:
          - name: "telepathy"
            level: 1
      - id: 49
        meta: 0
        amount: 32
        chance: 15
      - id: 466
        meta: 0
        amount: 16
        chance: 70
      - id: 7
        meta: 0
        amount: 5
        chance: 5
    amount: 1
    commands: ["say {PLAYER} has opened an Legendary Crate"]
    floating-text: "Legendary Crate"

如果您能抽出 10 分钟的时间帮助我找出问题所在,我将不胜感激!再次感谢!

【问题讨论】:

    标签: yaml pocketmine


    【解决方案1】:

    上下文中的第 93 行(最后一行是第 93 行):

          - id: 276
            meta: 0
            amount: 1
            chance: 50
            enchantments:
             - name: "Sharpness"
               level: 1
            commands:
             - "Say §e{PLAYER} Just Won a §2Diamond Sword With Sharpness 1 §2From a Vote Crate!"
            - id: 311
    

    第 93 行的列表项指示器 (-) 位于第 84 行 (id: 276) 开始的映射 级别。您收到错误是因为您无法将列表项放入映射中。错误消息告诉您,当它遇到其他东西(列表项指示器)时,它需要一个(映射的)键。

    要修复错误,请将行 (- id: 311) 放在与之前列表项相同的缩进级别:

          - id: 276
            meta: 0
            amount: 1
            chance: 50
            enchantments:
             - name: "Sharpness"
               level: 1
            commands:
             - "Say §e{PLAYER} Just Won a §2Diamond Sword With Sharpness 1 §2From a Vote Crate!"
          - id: 311
            meta: 0
            amount: 1
            chance: 9
            enchantments:
             - name: "Protection"
               level: 1
            commands:
             - "Say §e{PLAYER} Just Won §2Diamond Leggings With Protection 2§e From a Vote Crate!"
          - id: 438
            # ...
    

    - id: 438 和下面的- id: 339 也有错误的缩进。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-09
      • 2019-08-23
      • 1970-01-01
      相关资源
      最近更新 更多