如何添加与玩家健康相关联的老板栏,同时其他人能够看到它?

How do I add a boss bar linked to a player's health while other people being able to see it?

我有一个多人游戏服务器,基本上,我想让它成为这个事件中的老板。我想让它有一个与所述玩家的健康相关联的老板栏,并且对其他玩家可见。

这可以通过使用 Spigot API 创建一个插件轻松实现。

  1. 创建 BossBar
  2. 将所有应该看到它的玩家添加到 BossBar
  3. EntityDamageEvent,检查损坏的实体是否是目标玩家,并更新标题以显示玩家的新生命值