本帖最后由 逗比的幻影 于 2019-1-18 20:06 编辑

SimpleScoreboards


简介 ヽ(ˋ▽ˊ)ノ
这是一款基于Nukkit开发的计分板插件,它十分人性化,可以自定义编辑内容!
所需前置: ScoreboardAPI PlaceholderAPI (两款必备) EconomyAPI (显示金钱前置)

占位符 ┑( ̄▽  ̄)┍


部分占位符鄙人仍然不知是什么用处
%player% - 获取玩家的名字
%player_displayname% - 获取玩家的显示名称
%player_uuid% - 获取玩家的UUID
%player_ping% - 获取玩家的ping
%player_level% - 获取玩家所处世界名
%player_can_fly% - 获取玩家是否能够飞
%player_flying% - 玩家是否正在飞
%player_health% - 获得玩家的生命值
%player_max_health% - 获得玩家的最大生命值
%player_saturation% - Unknown
%player_food% - 获得玩家的饱食度
%player_gamemode% - 获取玩家的游戏模式
%player_x% - 获取玩家的x坐标
%player_y% - 获取玩家的y坐标
%player_z% - 获取玩家的z坐标
%player_direction% - Unknown
%player_exp% - 获得玩家经验值
%player_exp_to_next% - 获得玩家下一个等级等级所需的经验
%player_exp_level% - 获得玩家的等级
%player_speed% - 获取玩家的当前速度
%player_max_air% - Unknown
%player_remaining_air% - Unknown
%player_item_in_hand% - 获取玩家手持物品信息
%server_online% - 获取当前在线玩家数
%server_max_players% - 获取最大玩家数
%server_motd% - 获取服务器motd
%server_ram_used% - 获取已用内存
%server_ram_free% - 获取可用内存
%server_ram_total% - 获取总内存
%server_ram_max% -获取最大内存
%server_cores% - 获取可用处理器核心
%server_tps% - 获取当前TPS
%server_uptime% - 获取当前正常运行时间
%time% - 获取当前时间
%economy_money% - 获取玩家金钱信息 ( 需要前置EconomyAPI )

图片 ~( ̄▽ ̄~)(~ ̄▽ ̄)~

如果图片被压缩了请点击查看大图!
官网图片

个人使用



模板推荐 ( 颜色符号为 § )




  1. title: "§5§l墨 §e§l城 §b§l烟 §a§l柳"
  2. text:
  3. - ""
  4. - "§f玩 家: §eDobeShadow"
  5. - "§f等 级: §c2 §f级"
  6. - "§f称 号: §f[§c§l服主§f]"
  7. - "§f银 两: §a500.0 两"
  8. - "§f在 线: 1 人"
  9. - ""
  10. - "§f所 处: §a游戏大厅"
  11. - ""
  12. - "§f§lPlay.ChinaInk.tk"
复制代码

下载地址


[SimpleScoreboards] https://nukkitx.com/resources/simplescoreboards.195/
[ScoreboardAPI] https://nukkitx.com/resources/scoreboardapi.181/
[PlaceholderAPI] https://nukkitx.com/resources/placeholderapi.104/



PS: 更新了配置文件需要重启服务器!PlaceholderAPI需要前置插件 KotlinLib !


前置信息

ScoreboardAP I

ScoreboardAPI是一款由Amy所开发的一款计分板前置API类型的插件,它也可以编辑计分板,但是不能添加占位符!如果想要开发一款更棒的计分板插件,下面这个可能有助于您的开发!

  1. Scoreboard scoreboard = ScoreboardAPI.createScoreboard();
  2. ScoreboardDisplay scoreboardDisplay = scoreboard.addDisplay( DisplaySlot.SIDEBAR, "dumy", " This is the title" );
  3. ScoreboardDisplay.addLine( "This is a line", 0 );
  4. ScoreboardAPI.setScoreboard( player, scoreboard );
复制代码
PlaceholderAPI

PlaceholderAPI是一款基于Nukkit所开发变量插件,它提供给了Nukkit与Bukkit类似的变量系统!当然也是一款API!

1.获取API实例

  1. //in kotlin you can do
  2. val api = PlaceholderAPI.getInstance()

  3. //in java
  4. PlaceholderAPI api = PlaceholderAPIImpl.getInstance();

复制代码
2.获取占位符值

  1. //getting single placeholder value
  2. api.getValue(placeholderName, player); //player is optional and has an effect only for visitor sensitive placeholders

  3. //getting placeholdered string containing X placeholders
  4. api.translateString(inputString, player); //player is again optional for static placeholders
复制代码
3.创建一个新的占位符
  1. val api = PlaceholderAPI.getInstance()

  2. //creating static placeholder
  3. api.staticPlaceholder("tick", {Server.getInstance().tick}) //the simplest example

  4. //you can also specify update interval which indicates
  5. //how long should be value cached until it's recalculated (default is 1 second)

  6. //PlacholderAPI has also implemented auto updater which updates the placeholder
  7. //every period specified in update interval

  8. //autoupdating placehodler

  9. //this placeholder value will be refreshed every tick and automatically updated
  10. api.staticPlaceholder("tick", {Server.getInstance().tick}, 1, true)


  11. //creating visitor sensitive placeholder
  12. //it's almost the same as static. The only difference is that you can use Player instance parameter in the lambda

  13. api.visitorSensitivePlaceholder("isop", {p -> p.isOp}) //you can also use update interval and autoupdate parameters

  14. //every placecholder can have aliases which can be contained in vararg at the end of the method

  15. //if you want to have better control over the placeholder you can extend existing classes
  16. //and register Placeholder instance directly like
  17. api.registerPlaceholder(StaticPlaceHolder("test", 20, false, emptySet()) {"test"})
复制代码

点这里 可以查看详细的 API 内容

来自群组: NukkitPluginStudio