有人可以帮我找到我的权限文件的YAML文件有什么问题吗?

时间:2017-06-20 23:58:14

标签: yaml

当我通过在线YAML Parser运行时,我一直得到

error:"mapping values are not allowed here
  in "<unicode string>", line x, column x:
        x : x

就是这样:

groups:
  Default
    default: true
    build: true
    prefix: '&7[Member]&f'
    permissions
    - essentials.help
    - modifyworld.chat
    - modifyworld.*
    - essentials.afk
    - essentials.msg
    - essentials.mail
    - essentials.mail.send
    - essentials.home
    - essentials.sethome
    - essentials.delhome
    - essentials.back
    - essentials.tpa
    - essentials.tpaccept
    - essentials.tpdeny
    - essentials.spawn
    - essentials.warp
    - essentials.warplist
    - essentials.suicide
    - griefprevention.claims
    - griefprevention.buysellclaimblocks
    - griefprevention.givepet
    - griefprevention.ignore
    - griefprevention.siege
    - griefprevention.trapped
    - griefprevention.unlockdrops
    - horsetpwithme.pig
    - horsetpwithme.horse
    - horsetpwithme.llama

  Donator
    build: true
    inheritance:
    - Default
    prefix: '&6[Donator]&f'
    permissions:
    - essentials.enchant
    - essentials.repair
    - essentials.nick
    - essentials.home.others
    - horsetpwithme.nosaddle
    - horsetpwithme.worldbypass

  Moderator:
    build: true
    inheritance:
    - Default
    prefix: '&b[Moderator]&7'
    suffix: '&7'
    permissions:
    - essentials.motd
    - essentials.give 
    - essentials.repair
    - essentials.heal
    - essentials.item
    - essentials.fly
    - essentials.kick
    - essentials.mute
    - essentials.tjail
    - essentials.jail
    - essentials.tempban
    - essentials.vanish
    - essentials.spawn.others
    - griefprevention.restorenature
    - griefprevention.restorenatureaggressive
    - griefprevention.lava
    - griefprevention.adminclaims
    - griefprevention.claimslistother
    - griefprevention.ignoreclaims
    - griefprevention.deleteclaims
    - griefprevention.createclaims
    - griefprevention.transferclaim
    - griefprevention.adjustclaimblocks
    - griefprevention.visualizenearbyclaims
    - griefprevention.eavesdrop
    - griefprevention.eavesdropsigns
    - griefprevention.overrideclaimcountlimit
    - griefprevention.spam
    - griefprevention.siegeimmune
    - griefprevention.notignorable
    - griefprevention.seeinactivity
    - worldedit.*

  Admin:
    build: true
    inheritance:
    - Moderator
    prefix: '&4[&cAdmin&4]&e'
    suffix: '&7'
    permissions:   
    - essentials.gamemode
    - essentials.ban
    - essentials.unban
    - essentials.ipban
    - essentials.unipban
    - essentials.pardon
    - essentials.enchant
    - essentials.setspawn
  Owner:
    build:true
    inheritance:
    - Admin
    prefix: '&4[Owner]'
    suffix: '&b'
    permissions:
    - '*'

2 个答案:

答案 0 :(得分:1)

最后你有build:true没有空间,除此之外还有3个冒号:

groups:
  Default:
    default: true
    build: true
    prefix: '&7[Member]&f'
    permissions:
    - essentials.help
    - modifyworld.chat
    - modifyworld.*
    - essentials.afk
    - essentials.msg
    - essentials.mail
    - essentials.mail.send
    - essentials.home
    - essentials.sethome
    - essentials.delhome
    - essentials.back
    - essentials.tpa
    - essentials.tpaccept
    - essentials.tpdeny
    - essentials.spawn
    - essentials.warp
    - essentials.warplist
    - essentials.suicide
    - griefprevention.claims
    - griefprevention.buysellclaimblocks
    - griefprevention.givepet
    - griefprevention.ignore
    - griefprevention.siege
    - griefprevention.trapped
    - griefprevention.unlockdrops
    - horsetpwithme.pig
    - horsetpwithme.horse
    - horsetpwithme.llama

  Donator:
    build: true
    inheritance:
    - Default
    prefix: '&6[Donator]&f'
    permissions:
    - essentials.enchant
    - essentials.repair
    - essentials.nick
    - essentials.home.others
    - horsetpwithme.nosaddle
    - horsetpwithme.worldbypass

  Moderator:
    build: true
    inheritance:
    - Default
    prefix: '&b[Moderator]&7'
    suffix: '&7'
    permissions:
    - essentials.motd
    - essentials.give 
    - essentials.repair
    - essentials.heal
    - essentials.item
    - essentials.fly
    - essentials.kick
    - essentials.mute
    - essentials.tjail
    - essentials.jail
    - essentials.tempban
    - essentials.vanish
    - essentials.spawn.others
    - griefprevention.restorenature
    - griefprevention.restorenatureaggressive
    - griefprevention.lava
    - griefprevention.adminclaims
    - griefprevention.claimslistother
    - griefprevention.ignoreclaims
    - griefprevention.deleteclaims
    - griefprevention.createclaims
    - griefprevention.transferclaim
    - griefprevention.adjustclaimblocks
    - griefprevention.visualizenearbyclaims
    - griefprevention.eavesdrop
    - griefprevention.eavesdropsigns
    - griefprevention.overrideclaimcountlimit
    - griefprevention.spam
    - griefprevention.siegeimmune
    - griefprevention.notignorable
    - griefprevention.seeinactivity
    - worldedit.*

  Admin:
    build: true
    inheritance:
    - Moderator
    prefix: '&4[&cAdmin&4]&e'
    suffix: '&7'
    permissions:   
    - essentials.gamemode
    - essentials.ban
    - essentials.unban
    - essentials.ipban
    - essentials.unipban
    - essentials.pardon
    - essentials.enchant
    - essentials.setspawn
  Owner:
    build: true
    inheritance:
    - Admin
    prefix: '&4[Owner]'
    suffix: '&b'
    permissions:
    - '*'

答案 1 :(得分:0)

你错过了一些冒号。我通过YAMLlint验证了你的yaml,并发现了3个这三个错误。具体来说,第3,6和36行。这些数字的排列方式让我感到高兴。

您还在第107行错过inheritance密钥缩进。

有效的YAML将是:

--- 
groups: 
  Admin: 
    build: true
    inheritance: 
      - Moderator
    permissions: 
      - essentials.gamemode
      - essentials.ban
      - essentials.unban
      - essentials.ipban
      - essentials.unipban
      - essentials.pardon
      - essentials.enchant
      - essentials.setspawn
    prefix: "&4[&cAdmin&4]&e"
    suffix: "&7"
  Default: 
    build: true
    default: true
    permissions: 
      - essentials.help
      - modifyworld.chat
      - modifyworld.*
      - essentials.afk
      - essentials.msg
      - essentials.mail
      - essentials.mail.send
      - essentials.home
      - essentials.sethome
      - essentials.delhome
      - essentials.back
      - essentials.tpa
      - essentials.tpaccept
      - essentials.tpdeny
      - essentials.spawn
      - essentials.warp
      - essentials.warplist
      - essentials.suicide
      - griefprevention.claims
      - griefprevention.buysellclaimblocks
      - griefprevention.givepet
      - griefprevention.ignore
      - griefprevention.siege
      - griefprevention.trapped
      - griefprevention.unlockdrops
      - horsetpwithme.pig
      - horsetpwithme.horse
      - horsetpwithme.llama
    prefix: "&7[Member]&f"
  Donator: 
    build: true
    inheritance: 
      - Default
    permissions: 
      - essentials.enchant
      - essentials.repair
      - essentials.nick
      - essentials.home.others
      - horsetpwithme.nosaddle
      - horsetpwithme.worldbypass
    prefix: "&6[Donator]&f"
  Moderator: 
    build: true
    inheritance: 
      - Default
    permissions: 
      - essentials.motd
      - essentials.give
      - essentials.repair
      - essentials.heal
      - essentials.item
      - essentials.fly
      - essentials.kick
      - essentials.mute
      - essentials.tjail
      - essentials.jail
      - essentials.tempban
      - essentials.vanish
      - essentials.spawn.others
      - griefprevention.restorenature
      - griefprevention.restorenatureaggressive
      - griefprevention.lava
      - griefprevention.adminclaims
      - griefprevention.claimslistother
      - griefprevention.ignoreclaims
      - griefprevention.deleteclaims
      - griefprevention.createclaims
      - griefprevention.transferclaim
      - griefprevention.adjustclaimblocks
      - griefprevention.visualizenearbyclaims
      - griefprevention.eavesdrop
      - griefprevention.eavesdropsigns
      - griefprevention.overrideclaimcountlimit
      - griefprevention.spam
      - griefprevention.siegeimmune
      - griefprevention.notignorable
      - griefprevention.seeinactivity
      - worldedit.*
    prefix: "&b[Moderator]&7"
    suffix: "&7"
  Owner: 
    build: true
    inheritance: 
      - Admin
    permissions: 
      - "*"
    prefix: "&4[Owner]"
    suffix: "&b"