• MineBBS 第一期星光推广计划开始了!丰富的金粒奖励,还有现金大奖噢~【点我去看看】
排行榜-自定义的排行榜对接记分板

LLSE 排行榜-自定义的排行榜对接记分板 0.0.2

Source of resources
Original
Copyright link
#
Language
Multi-language
Supported version
  1. The latest version
你可以自定义排行榜

打开排行榜

/排行榜 和 /top

加载配置
/排行榜 重载 和 /top reload

配置文件路径
.\\plugins\\Yoyo\\RankingList\\config.json

配置文件Json
JSON:
{
"count":15,#这是排行最大显示数量
    "Scores": [  #这个数组里面放你需要记录的记分项 它是字符串 "所以要双引号包围"
        "money"
    ],
    "List": [#这里就是增加一个自定义排行榜
        {
            "name": "金币排行榜", #显示名称
            "binding": "money",   #绑定记分项
            "showFormat": "%R%,§2%P%-§6%S%金币" #自定义显示格式
        },
         {
            "name": "自定义指令 Hello",
            "type": "cmd",
            "cmd": "/title @s title Hello"
        }
    ]
}

#showFormat的显示格式如下:
%R% - 当前名次
%P% - 玩家名
%S% - 记分项值
如果你对自己修改的JSON格式有疑惑
你可以点击 JSON格式验证 去看看是否正确


20210913095109.png
20210913095128.png


这里提供了一个扩展 (死亡,挖掘,击杀) 三大排行榜
JavaScript:
//自定义排行榜扩展

let Kscore = "yoyo_kill";//击杀 自定义
let Dscore = "yoyo_die";//死亡 自定义
let Bscore = "yoyo_BrixBuster";//挖掘 自定义

mc.listen("onPlayerDie",onPlayerDie);
mc.listen("onServerStarted",onServerStarted);
mc.listen("onDestroyBlock",onDestroyBlock);

function onPlayerDie(player,source) {
    let dcores = mc.getScoreObjective(Dscore);
    if(dcores !=null){
        player.addScore(Dscore,1);
    }

    if(source==null) return;
    if(source.isPlayer()){
        let Sscores = mc.getScoreObjective(Kscore);
        if(Sscores !=null){
            let pl = source.toPlayer();
            pl.addScore(Kscore,1);
        }
    }
}


function onDestroyBlock(player,block) {
    let bcores = mc.getScoreObjective(Bscore);
    if(bcores !=null){
        player.addScore(Bscore,1);
    }
}





function onServerStarted() {
    CraScore(Kscore);
    CraScore(Dscore);
    CraScore(Bscore);
}


function CraScore(score) {
    let Scores = mc.getScoreObjective(score);
    if(Scores ==null){
        mc.newScoreObjective(score,"yoyo_LBE");
    }
}

这里是它配套的配置文件
JSON:
{
    "count": 15,
    "Scores": [
        "yoyo_kill",
        "yoyo_die",
        "yoyo_BrixBuster"
    ],
    "List": [
        {
            "name": "玩击杀排行榜",
            "binding": "yoyo_kill",
            "showFormat": "%R%,§2%P%-§6%S%人数"
        },
        {
            "name": "玩家死亡排行榜",
            "binding": "yoyo_die",
            "showFormat": "%R%,§2%P%-§5%S% 次暴毙"
        },
        {
            "name": "玩家挖掘排行榜",
            "binding": "yoyo_BrixBuster",
            "showFormat": "%R%,§2%P%-§5%S% 个方块"
        }
    ]
}
1688170451652.jpeg
Author
Yoyo666
Price
30金粒
Downloads
134
Views
3,232
First release
Last update
Rating
4.75 star(s) 4 ratings

More resources from Yoyo666

Share this resource

Latest updates

  1. 适配新版本

    适配新版本
  2. 自动适配 1.17.3

    水更新
  3. 更新 0.0.2

    增加 支持自定义指令配置

Latest reviews

Hello can you please make a guide on youtube or like to write here. How to make kill/death scoreboards. I can't figure out how to activate your add-on custom.js and where should its config appear
yoyo一天一插件?
挺不错的,很方便。
kill 排行榜 你能做到嗎我非常想要
Yoyo666
Yoyo666
All you need to do is make an event to listen for a Kill and score points on the player's scoreboard