1 004
收录服务器
1304
注册
44 401
玩家
HoloMobHealth 显示生物血量 伤害指示器 客户端 JavaScript 格式化
显示暴徒健康客户端只有通过包!支持定制的JavaScript格式!
作 者 LOOHP
发布时间 2020年3月12日
支持核心 Spigot
原生版本
支持版本 1.8,1.9,1.10,1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19,1.20
点此下载

HoloMobHealth 是一款 Minecraft 插件,用于在生物头顶显示其剩余生命值。该插件高度可定制,允许你自定义生命值显示的方式,例如使用数字、百分比或爱心符号。它完全是客户端的,这意味着它不会影响服务器上的生物数据,也不会导致死亡消息中出现乱码。

🎉

HoloMobHealth

支持的 Minecraft 版本

  • 原生 Minecraft 版本: 1.21
  • 测试 Minecraft 版本: 1.8 - 1.21 (包括 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.20.6, 1.21)

🔗 链接

✨ 特性

  1. 生物头顶显示生命值: 在所有生物头顶显示生命值。
  2. 可定制的生命值显示: 提供多种占位符,允许你自定义显示方式。
  3. 支持爱心显示: 可以使用爱心符号代替文本显示生命值。
  4. 伤害指示器: 显示生物受到的伤害和治疗量(1.11+)。
  5. 完全客户端: 不修改服务器上的生物数据,仅为视觉效果。
  6. 自定义占位符脚本: 通过 JavaScript 创建自定义占位符。
  7. 语言和生物类型: 支持多语言,并能识别村民职业和热带鱼类型。
  8. 生物黑名单: 将特定生物类型或名称的生物排除在生命值显示之外。
  9. 动态生命值显示: 仅在生物受到攻击或伤害时显示生命值。
  10. 支持 RGB 和字体: 使用 RGB 代码和自定义字体(1.16+)。
    
    &x&F&F&F&F&F&F
    或
    [color=#ffffff]
    如果有一个具有不同字体的自定义资源包,你甚至可以像颜色代码一样使用它们!
    [font=myawesomefont]
        
  11. 与其他插件兼容: 支持 MyPet, Citizens, MythicMobs, Shopkeeper 和 PlaceholderAPI。

插件支持

  • MythicMobs (部分支持)
  • Citizens (除了玩家类型的生物)
  • Shopkeepers
  • MyPet
  • ModelEngine (部分支持,实验性)
  • PlaceholderAPI
  • WorldGuard (需要至少 v7)

依赖

  • ProtocolLib (请安装与您的服务器版本兼容的最新版本)

⚙️ 安装

  1. 将 HoloMobHealth.jar 和依赖插件放入 plugins 文件夹。
  2. 启动服务器。
  3. 编辑配置文件(如果需要)。
  4. 重启服务器(如果修改了配置文件)。

💻 命令

  • /holomobhealth reload (或 /hmh reload) - 重载插件
  • /holomobhealth update (或 /hmh update) - 检查更新
  • /holomobhealth toggle (或 /hmh toggle) - 切换自己的生物生命值显示

🔑 权限


permissions:
  holomobhealth.reload:
    description: 允许您重新加载插件
    default: op
  holomobhealth.use:
    description: 允许您查看生命值显示
    default: true
  holomobhealth.toggle:
    description: 允许您切换自己的生命值显示
    default: true
  holomobhealth.toggle.others:
    description: 允许您切换其他人的生命值显示
    default: op
  holomobhealth.update:
    description: 允许您接收更新通知
    default: op

📝 默认配置

最新配置带有说明。

⚠️ 限制

  • AlwaysShow 在 1.8 中由于 Minecraft 的一个 bug 而无法工作。
  • Multi-Line 在 1.8 - 1.9.4 上不被支持。
  • 伪装成玩家类型的生物不会显示生命值,因为玩家名称和生物名称的处理方式不同。

配置示例


# +-------------------------------------------------------------------------------------------------------------------+
# |    ____             _                   _               _____       _               _                             |
# |   / ___| _ __   __| | ___  _ __   ___ | |_   _ __ ___ | ____|_ __ | | ___   __ _  | | ___                       |
# |   \___ \| '_ \ / _` |/ _ \| '_ \ / _ \| __| | '__/ _ \|  _| | '_ \| |/ _ \ / _` | | |/ _ \                      |
# |    ___) | |_) | (_| | (_) | | | | (_) | |_  | | | (_) | |___| | | | | (_) | (_| | | |  __/                      |
# |   |____/| .__/ \__,_|\___/|_| |_|\___/ \__| |_|  \___/|_____|_| |_|_|\___/ \__,_| |_|\___|                      |
# |         |_|                                                                                                     |
# +-------------------------------------------------------------------------------------------------------------------+
#
# Documentation can be found here: https://github.com/LOOHP/HoloMobHealth/wiki/Configuration
#
# Color Codes: https://minecraft.fandom.com/wiki/Formatting_codes
# RGB Colors: &x&R&R&G&G&B&B or [color=#RRGGBB]
# Font: [font=fontname]
#
# Placeholders that you can use in messages:
# {health} - Mob's current health
# {maxHealth} - Mob's maximum health
# {percent} - Mob's health percentage
# {name} - Mob's name (if it has one)
# {distance} - Distance from the mob in blocks
# {entityType} - Mob's type (e.g. Zombie, Cow, etc.)
# {entityTypeName} - Mob's translated type name (e.g. Zombie, Cow, etc.)
# {formattedName} - Mob's formatted name (Name or Type if it doesn't have a name)
# {formattedHealth} - Mob's formatted health (Health / Max Health)
# {scaledHealth} - Mob's health scaled to a value
# {scaledMaxHealth} - Mob's maximum health scaled to a value
# {scaledSymbols} - Mob's health as a number of symbols (e.g. Hearts)
# {strippedName} - Mob's name without formatting
# {strippedType} - Mob's type without formatting
# {strippedFormattedName} - Mob's formatted name without formatting
# {healthbar} - A health bar that displays the health
# {damage} - The damage dealt to the mob (Damage Indicators)
# {custom} - Custom placeholder from PlaceholderAPI
# {script:scriptname} - Custom placeholder script (See Placeholder Scripts)
# {newLine} - New line
# {space} - Space
# {empty} - Empty String
# {playerHead} - Player's head (Only works for players, needs to be enabled in the config)
#
# Placeholders that you can use in Damage Indicator messages:
# {damage} - The damage dealt to the mob
# {health} - Mob's current health
# {maxHealth} - Mob's maximum health
# {name} - Mob's name (if it has one)
# {entityType} - Mob's type (e.g. Zombie, Cow, etc.)
#
# Placeholders that you can use in Damage Indicator display names:
# {damage} - The damage dealt to the mob
# {health} - Mob's current health
# {maxHealth} - Mob's maximum health
# {name} - Mob's name (if it has one)
# {entityType} - Mob's type (e.g. Zombie, Cow, etc.)
#
# Placeholders that you can use in Conditions
# health - Mob's current health
# maxHealth - Mob's maximum health
# percent - Mob's health percentage
# name - Mob's name (if it has one)
# distance - Distance from the mob in blocks
# entityType - Mob's type (e.g. Zombie, Cow, etc.)
# world - World name
# isBaby - Is the mob a baby
# hasPassenger - Does the mob have a passenger
# isLeashed - Is the mob leashed
# isInvisible - Is the mob invisible
# hasPotionEffect - Does the mob have a potion effect
# isGlowing - Is the mob glowing
# custom - Custom placeholder from PlaceholderAPI
# script - Custom placeholder script (See Placeholder Scripts)

settings:
  # Whether to display the health of mobs
  enable: true

  # Display health only when the mob is attacked
  dynamic-display: false

  # Disable health display for mobs in spectator mode
  spectator-mode-check: true

  # Show the health of invisible mobs
  show-invisible: false

  # Update rate in ticks
  update-rate: 2

  # Max distance to display health (0 = infinite)
  max-distance: 64

  # Whether to align the health display with the mob's head (Requires ModelEngine Support)
  align-with-head: false

  # Height offset of the health display
  height-offset: 2.2

  # Multiplier for the height offset based on the mob's height
  height-multiplier: 0.2

  # Whether to display player heads instead of names (Only works for players)
  player-head: false

  # Show health of players
  player-health: true

  # Show health of named mobs only (Overrides named-mobs-only)
  named-mobs:
    only: false
    # Show health alongside named mobs instead of overriding it
    display-alongside: false

  # Show health for mobs with a custom name tag from resource pack only (Overrides named-mobs-only)
  resource-pack-mobs: false

  # Show health of boss mobs
  boss-mobs: true

  # Show health of mobs from these plugins
  plugin-mobs:
    my-pet: true
    citizens: false
    mythic-mobs: false
    shopkeeper: true

  # Display health based on condition
  conditions:
    enable: false
    condition: "health < maxHealth"
    # When condition is false
    hide-when-false: false

  # World whitelist / blacklist
  world:
    enable: false
    whitelist: false
    worlds:
      - "world_nether"
      - "world_the_end"

  # Prevent health display in certain WorldGuard regions
  worldguard:
    enable: false
    # Flag to check for
    flag: "holomobhealth-hide"

  # Hide health in certain light level
  light-level:
    enable: false
    max-level: 7

  # Blacklist certain mobs
  blacklist:
    mob-types:
      - "ARMOR_STAND"
    mob-names:
      - "Dinnerbone"
      - "Grumm"
    name-contains:
      - "Example"
      - "&cExample"

  # Custom Model Data
  custom-model-data:
    enable: false
    # Mobs with these custom model data will have their health hidden
    blacklist:
      - 1234
      - 5678
    # Mobs with these custom model data will have the display replaced
    replace:
      12345: "&cExample"

  # ModelEngine
  modelengine:
    enable: false
    # Height offset of the health display
    height-offset: 0.0

    # Always update health display
    always-update: false

  # Health Bar
  health-bar:
    enable: true

    # The symbol used to represent a full health point
    symbol: "&a%rounded_rectangle%"

    # The symbol used to represent an empty health point
    empty-symbol: "&c%rounded_rectangle%"

    # The length of the health bar
    length: 20

    # The color of the health bar
    color: "&a"

    # The color of the empty health bar
    empty-color: "&c"

    # Scale the health to the length of the bar
    scale-health: true

  # Damage Indicators
  damage-indicators:
    enable: true

    # Show damage indicators only when the mob is attacked
    dynamic-display: false

    # Update rate in ticks
    update-rate: 5

    # Max distance to display damage indicators (0 = infinite)
    max-distance: 16

    # The offset of the damage indicator relative to the mob's head
    offset: 0.7

    # Whether to display damage indicators in the direction of the player
    look-at-player: true

    # The speed at which the damage indicator moves
    velocity: 0.1

    # The gravity of the damage indicator
    gravity: 0.05

    # Damage indicator display name settings
    display-name:
      # Whether to enable display names for damage indicators
      enable: true

      # The display name format for damage indicators
      format: "&c-{damage}"

      # Whether to enable custom model data for damage indicators
      custom-model-data:
        enable: true

        # The custom model data to use for damage indicators
        data: 12345

    # Formatting settings for damage indicators
    formatting:
      # The minimum size of the damage indicator
      min-size: 8

      # The maximum size of the damage indicator
      max-size: 16

      # Whether to enable fade-in effect for damage indicators
      fade-in: true

      # The duration of the fade-in effect in ticks
      fade-in-duration: 5

      # Whether to enable fade-out effect for damage indicators
      fade-out: true

      # The duration of the fade-out effect in ticks
      fade-out-duration: 20

# +-------------------------------------------------------------------------------------------------------------------+
# |                                                Message Settings                                                   |
# +-------------------------------------------------------------------------------------------------------------------+
messages:
  # Main message
  main: "&c{formattedHealth} &7(&f{health}&7/&f{maxHealth}&7)"

  # Update message
  update:
    available: "&aThere is a new version of HoloMobHealth available! (v{version})"
    no-update: "&cYou are using the latest version of HoloMobHealth!"

  # Toggle message
  toggle:
    enabled: "&aHoloMobHealth has been enabled!"
    disabled: "&cHoloMobHealth has been disabled!"

  # Reload message
  reload: "&aHoloMobHealth has been reloaded!"
  reload-failed: "&cHoloMobHealth failed to reload! Check console for errors!"

  # Damage indicator message
  damage-indicator: "&c{damage}"

# +-------------------------------------------------------------------------------------------------------------------+
# |                                                 Placeholder Scripts                                               |
# +-------------------------------------------------------------------------------------------------------------------+
# You can create your own placeholders through the use of JavaScript
#
# To use a script, use the placeholder {script:scriptname} in the messages
# Example: {script:example}
# You can also use PlaceholderAPI placeholders in the scripts
#
# Available variables:
# - player: The player who is seeing the health display
# - entity: The entity who's health is being displayed
# - health: The entity's current health
# - maxHealth: The entity's maximum health
# - name: The entity's name
# - entityType: The entity's type
#
# Available functions:
# - PlaceholderAPI.setPlaceholders(Player player, String text): Replaces PlaceholderAPI placeholders in the text
# - PlaceholderAPI.containsPlaceholders(String text): Checks if the text contains PlaceholderAPI placeholders
#
# Example:
#  example: |
#   var name = entity.getName();
#   if (name == null || name.isEmpty()) {
#    name = entityType;
#   }
#   '&a' + name + ' is at ' + health + '/' + maxHealth + ' health!';
scripts:
  example: |
    var name = entity.getName();
    if (name == null || name.isEmpty()) {
     name = entityType;
    }
    '&a' + name + ' is at ' + health + '/' + maxHealth + ' health!';

# +-------------------------------------------------------------------------------------------------------------------+
# |                                                 Advanced Settings                                                 |
# +-------------------------------------------------------------------------------------------------------------------+
advanced:
  # Whether to use the advanced NMS system to get the entity's name (Requires ProtocolLib)
  use-advanced-name-system: true

  # Whether to use the advanced NMS system to set the entity's name (Requires ProtocolLib)
  use-advanced-set-name-system: true

  # Whether to debug the plugin
  debug: false

  # Whether to enable metrics
  metrics: true

  # Whether to check for updates
  update-check: true

  # Which system to use to get the entity's type name
  entity-type-name-system: "LEGACY"

  # Which system to use to create the hologram
  hologram-system: "NATIVE"

  # Which system to use to get the entity's custom name
  custom-name-system: "LEGACY"

  # Which system to use to get the entity's custom name
  custom-model-data-system: "LEGACY"

  # Whether to use the optimized check for entities
  optimized-entity-check: true

  # Custom damage indicators
  custom-damage-indicators:
    enable: false
    # The item to use for the damage indicator
    item: "STONE"
    # The amount of damage indicators to spawn
    amount: 1
    # The spread of the damage indicators
    spread: 0.5