尘晓凡
本帖最后由 帅比小樊 于 2017-3-12 20:56 编辑

                                             Boolean enchs = this.getConfig().getBoolean("enchs");
        Boolean tiezs = this.getConfig().getBoolean("tiezs");
        int Level = this.getConfig().getInt("SET.1.Level");

        String lore1 = this.getConfig().getString("SET.1.lore1");
        int eatime = this.getConfig().getInt("SET.1.eatime");
        int beishu1 = this.getConfig().getInt("SET.1.beishu1");
        int money = this.getConfig().getInt("SET.1.money");
        String name1 = this.getConfig().getString("SET.1.name1");
这是在插件里写的↑
接下来是config.yml里的信息↓
  1. DFR:
  2.     enchs: false
  3.     tiezs: false
  4. SET:
  5.   1:
  6.     Level: 20
  7.     name1: '这是一个丹药的name'
  8.     lore1: '这是一个丹药的lore'
  9.     eatime: 5
  10.     beishu1: 1.1
  11.     money: 10
复制代码
但是在游戏里面根本就无法读取,比如我弄了个指令

输入后会发出lore1的消息,但是根本没用,所以只好求大神来解决了,急啊!!!!!!!!!!!!!!!!!!!!!!快审核 dalao!




2021.12 数据,可能有更多内容            Boolean enchs = this.getConfig().getBoolean("enchs");
        Boolean tiezs = this.getConfig().getBoolean("tiezs");
        int Level = this.getConfig().getInt("SET.1.Level");

        String lore1 = this.getConfig().getString("SET.1.lore1");
        int eatime = this.getConfig().getInt("SET.1.eatime");
        int beishu1 = this.getConfig().getInt("SET.1.beishu1");
        int money = this.getConfig().getInt("SET.1.money");
        String name1 = this.getConfig().getString("SET.1.name1");
这是在插件里写的↑
接下来是config.yml里的信息↓

代码:

  1. DFR:
  2.     enchs: false
  3.     tiezs: false
  4. SET:
  5. 1:
  6.     Level: 20
  7.     name1: '这是一个丹药的name'
  8.     lore1: '这是一个丹药的lore'
  9.     eatime: 5
  10.     beishu1: 1.1
  11.     money: 10
但是在游戏里面根本就无法读取,比如我弄了个指令

输入后会发出lore1的消息,但是根本没用,所以只好求大神来解决了,急啊!!!!!!!!!!!!!!!!!!!!!!快审核 dalao!






a8105
你帖代码用大字体看得我非常难受_(:з」∠)_
无法读取的具体呢?
大概是读取不到正确的数值
如果是config.yml
请问是否已经载入好了默认的配置文件:
saveDefaultConfig();
如果一个saveDefaultConfig()不行,那就再来个reloadConfig()←_←

as_always
第一点 你的字体让人家读起来很难受,第二发过来的东西找不到问问题,第三我认可能是文件编码格式的的问题。第四报错之后控制台输出了什么?

尘晓凡
810587921 发表于 2017-3-13 01:05
你帖代码用大字体看得我非常难受_(:з」∠)_
无法读取的具体呢?
大概是读取不到正确的数值

开头有写,能不能说说dalao你的配置方法?

尘晓凡
as_always 发表于 2017-3-13 16:19
第一点 你的字体让人家读起来很难受,第二发过来的东西找不到问问题,第三我认可能是文件编码格式的的问题 ...

那是怎么样的编码格式,能具体说出来吗?