0

我拥有一个 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 分钟的时间帮助我找出问题所在,我将不胜感激!再次感谢!

4

1 回答 1

2

Line 93 in context (the last line is line 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

The list item indicator (-) of line 93 is on the level of the mapping started at line 84 (id: 276). You get the error because you cannot put a list item into a mapping. The error message tells you it expected a key (of the mapping) when it encountered something else (the list item indicator).

To fix the error, put the line (- id: 311) on the same indentation level as the previous list items:

      - 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 and the following - id: 339 also have a wrong indentation.

于 2020-06-01T17:15:18.470 回答