Skip to content

Entity HP Tracking & Damage System #82

Description

@FirebrickRed

Summary

Track entity HP, handle damage/healing, visual HP indicators, and death mechanics. Foundation for combat system integration.

Phase: 5 - Combat Integration (Future)
Systems: Combat System, Entity System

Prerequisites

Goals

  • Track current HP separate from max HP
  • /dmentity hp <entity> set <value> - Set current HP
  • /dmentity hp <entity> damage <amount> - Deal damage
  • /dmentity hp <entity> heal <amount> - Heal entity
  • Visual HP indicators (boss bar? name tag?)
  • Death handling (drop loot, remove entity)
  • Temporary HP support
  • Unconscious state (0 HP but not dead)

Commands

# View entity HP
/dmentity hp kobold view
> Skrix: 5/5 HP

# Damage entity
/dmentity hp kobold damage 3
> Skrix takes 3 damage (5 → 2 HP)

# Heal entity
/dmentity hp kobold heal 2
> Skrix healed 2 HP (2 → 4 HP)

# Set HP directly
/dmentity hp kobold set 10
> Skrix HP set to 10

Visual Indicators

// Boss bar for important entities
BossBar hpBar = Bukkit.createBossBar(
    "Skrix",
    BarColor.RED,
    BarStyle.SOLID
);
hpBar.setProgress(currentHp / maxHp);

// Or name tag display
entity.setCustomName("Skrix [2/5 HP]");

Death Handling

# YAML configuration
id: kobold
death:
  action: remove  # remove, unconscious, persist_body
  drop_loot: true
  broadcast_message: "The kobold falls!"
# When HP reaches 0
> Skrix takes 5 damage (2 → 0 HP)
> Broadcast: "The kobold falls!"
> [Drops loot from loot_table]
> [Entity removed from world]

Temporary HP

/dmentity hp kobold temphp 5
> Skrix gains 5 temporary HP

# Temp HP absorbed first
/dmentity hp kobold damage 3
> Skrix temporary HP: 5 → 2
> Skrix HP: 5/5 (unchanged)

Next Steps

After completing this issue, tackle:

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    combatCombat, HP, initiative, damageenhancementNew feature or requestnpc/entityFor issues pertaining to npc's or monsters and is referred to as entities in the mod pack

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions