Skip to content
Mitality edited this page Nov 13, 2024 · 26 revisions

This assumes you already have a Minecraft server set up using Spigot-based software (such as Paper or Purpur) and you have access to its file structure!

Installation

  • Download the latest release version of BodyHealth either from GitHub or Spigot.
  • If you want to make use of BodyHealth's Betterhud integration to display health per body part via a head up display in game, you also want to download BetterHud and PlaceholderAPI if you haven't already. With just PAPI, you may also build your own display by using placeholders from BodyHealth's PlaceholderAPI extension.
  • Drop the downloaded .jar files into the plugins folder of your server and (re)start it.

Configuration

  • If you are using a permissions plugin like LuckPerms and you have groups/users with a * wildcart (permission shortcut for all permissions), you immediately want to deny the permission node bodyhealth.bypass.* to all groups/users that have all permissions per default. Players with bypass permissions don't naturally take damage to body parts or regenerate their respective health, so you probably want to do this before further testing anything if this is the case for you.

For the next steps, navigate to plugins/BodyHealth and edit the config.yml file there. Most settings are completely optional, but there are a few that you are supposed to adjust to your needs:


  • First, you want to decide how much health each body part should have. Scroll down to where it says body-health: and adjust the given settings to match your imagination. You can even have the health of a body part depend on the players vanilla max health as shown with HEAD and BODY on default settings.
# Specify the maximum health for each body part
# (can use %PlayerMaxHealth% as placeholder)
body-health:
  HEAD: "%PlayerMaxHealth% * 0.5"
  BODY: "%PlayerMaxHealth% / 2"
  ARM_LEFT: 10.0
  ARM_RIGHT: 10.0
  LEG_LEFT: 7.5
  LEG_RIGHT: 7.5
  FOOT_LEFT: 5
  FOOT_RIGHT: 5



  • Now, scroll further down to where it says effects:. This section contains a list of all eight body parts and the five state they can be in. Due to this list containing every possible combination of a state and a body part, configuring effects is very easy! You just choose one ore more effects from the sections description (e.g. PREVENT_JUMP) and add it/them to the right list. For example, if you wanted players who broke their left leg to be unable to jump, you could add PREVENT_JUMP to effects.LEFT_LEG.BROKEN.

You may want to apply the same effect at multiple states of a body part. For example BROKEN in addition to DAMAGED to preserve the effect on 0% health

# Configure effects per body part and body part state:
#
#   Effects (<> = required, [] = optional):
#
#      POTION_EFFECT / <EFFECT> / [AMPLIFIER]   ...apply a specific potion effect (amplifier defaults to 1 if not specified)
#      PREVENT_INTERACT / <HAND> / [MESSAGE]    ...prevent the player from interacting with a given hand (HAND / OFF_HAND)
#      PREVENT_SPRINT / [MESSAGE]               ...prevent the player from sprinting (sets sprint speed to walk speed)
#      PREVENT_WALK                             ...prevent the player from walking at all (player can still be knocked back)
#      PREVENT_JUMP                             ...prevent the player from jumping (player can still climb stairs etc.)
#      COMMAND / cmd args[...]                  ...execute a command (can use %PlayerName% and %PlayerUUID% as placeholders)
#      COMMAND_UNDO / cmd args[...]             ...execute a command when the condition is no longer met (to undo stuff)
#      KILL_PLAYER                              ...you guessed it, this kills the player when the condition is met
#      SEND_MESSAGE / <MESSAGE>                 ...send a message to the player to notify them of their status
#
#   <MESSAGE> (or [MESSAGE]) can be the following:
#
#      actionbar:this will be displayed in the actionbar
#      title:this is a title; this is a subtitle
#      this is a normal chat message
#
#   All message variants can use colorcodes like &c (=red).
#
#   FULL » Health is at maximumx
#   NEARLYFULL » Health is between 50% and full
#   INTERMEDIATE » Health is between 25% and 50%
#   DAMAGED » Health is below 25%
#   BROKEN » No health left
#
# Some examples have already been configured for you, but you are meant to adjust them:
effects:
  HEAD:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED:
      - SEND_MESSAGE / TITLE:&4Caution!;&cYou are about to die # Warn players with a title when their health gets below 25%
    BROKEN:
      - KILL_PLAYER # Kill the player when their head reaches 0 HP
  BODY:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED:
      - SEND_MESSAGE / &cYour body is now below 25% health # Send a normal chat message to the player, informing them of their body health state
    BROKEN:
      - COMMAND / attribute %PlayerName% minecraft:generic.scale base set 2 # Make the player two times as tall when their body reaches 0 HP
      - COMMAND_UNDO / attribute %PlayerName% minecraft:generic.scale base set 1 # Set the players scale back to normal when their body recovers
  ARM_LEFT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED: []
    BROKEN:
      - PREVENT_INTERACT / OFF_HAND / actionbar:&cYou arm hurts badly! # Prevent off-hand usage of their left arm is at 0 HP and notify them via their actionbar if they try to use it
  ARM_RIGHT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED: []
    BROKEN:
      - PREVENT_INTERACT / HAND / actionbar:&cYou arm hurts badly! # Prevent main-hand usage of their right arm is at 0 HP and notify them via their actionbar if they try to use it
  LEG_LEFT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED:
      - PREVENT_SPRINT # Prevent the player from sprinting when their left legs health is below 25%
      - PREVENT_JUMP # Prevent the player from jumping when their left legs health is below 25%
    BROKEN:
      - POTION_EFFECT / SLOWNESS / 3 # Apply the SLOWNESS effect (lvl 3) to players whose left leg is at 0 HP
      - PREVENT_JUMP # Prevent the player from jumping when their right legs health is at 0 HP
  LEG_RIGHT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED:
      - PREVENT_SPRINT # Prevent the player from sprinting when their right legs health is below 25%
      - PREVENT_JUMP # Prevent the player from jumping when their right legs health is below 25%
    BROKEN:
      - POTION_EFFECT / SLOWNESS / 3 # Apply the SLOWNESS effect (lvl 3) to players whose right leg is at 0 HP
      - PREVENT_JUMP # Prevent the player from jumping when their right legs health is at 0 HP
  FOOT_LEFT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED: []
    BROKEN:
      - PREVENT_WALK # Prevent the player from moving walking at all when left foot reaches 0 HP
  FOOT_RIGHT:
    FULL: []
    NEARLYFULL: []
    INTERMEDIATE: []
    DAMAGED: []
    BROKEN:
      - PREVENT_WALK # Prevent the player from moving walking at all when right foot reaches 0 HP

An empty list ([]) means no effects are applied.



...and that's the most essential setup done!

  • If you chose to use BodyHealth's BetterHud integration and you have installed both dependencies necessary for it to work, you will now find a resource pack at plugins/BodyHealth/resource_pack.zip. Without this, players just see a yellow bossbar and weird rectangle characters above it, so make sure to either give it to anyone who plays with you or use a resource pack management plugin to auto-apply it.

Now, you can choose to either enjoy already or take a closer look at the configuration to tweak the heck out of this plugin :P

Hope this helped - if it didn't feel free to open a ticket here to receive further assistance :)

Clone this wiki locally