promotional bannermobile promotional banner

HTDevLib

A comprehensive utility library for Hytale plugin development, providing tested helpers and utilities that simplify common modding tasks.

File Details

HYTALEDEVLIB-0.3.5.jar

  • R
  • Jan 19, 2026
  • 119.11 KB
  • 101
  • Early Access

File Name

HYTALEDEVLIB-0.3.5.jar

Supported Versions

  • Early Access

Version 0.3.5

New Features

StatsHelper - Entity Stats Management

  • NEW: Complete entity stats management system for health, stamina, mana, and more
  • getStat(entity, statName) / setStat(entity, statName, value) - Get/set any stat by name
  • addStat(entity, statName, amount) - Add to stat (can be negative to subtract)
  • Convenience methods - Quick access to common stats
    • getHealth() / setHealth() - Health stat
    • getStamina() / setStamina() - Stamina stat
    • getMana() / setMana() - Mana stat
    • getOxygen() / setOxygen() - Oxygen stat
  • Stat queries
    • getStatMin() / getStatMax() - Get min/max values
    • getStatPercentage() - Get stat as percentage (0.0 to 1.0)
    • hasStat() - Check if entity has a stat
  • Min/Max operations
    • maximizeStat() - Set stat to maximum
    • minimizeStat() - Set stat to minimum
    • resetStat() - Reset to initial/default value
  • Stat modifiers - Add buffs/debuffs to stats
    • addModifier() - Add custom modifier with target and calculation type
    • addAdditiveModifier() - Add flat bonus (e.g., +20 health from armor)
    • addMultiplicativeModifier() - Add percentage bonus (e.g., 1.5x health from potion)
    • removeModifier() - Remove modifier by key
    • getModifier() - Get modifier by key
  • Auto-clamping - Values automatically clamped between min and max
  • Modifier stacking - Multiple modifiers with different keys stack

DeathHelper - Entity Death Tracking

  • NEW: Complete entity death tracking system with killer info and damage source
  • onEntityDeath(world, callback) - Register callback for entity deaths
  • EntityDeath class - Comprehensive death information object with helper methods
    • getEntityName() - Get name of entity that died (player username or NPC role name)
    • isPlayer() - Check if entity is a player
    • getKillerName() - Get name of killer entity
    • isKillerPlayer() - Check if killer is a player
    • wasKilledByEntity() - Check if killed by another entity
    • wasKilledByProjectile() - Check if killed by projectile
    • wasKilledByEnvironment() - Check if killed by environment (fall, drown, etc.)
    • getPosition() - Get death position coordinates
    • getDamageInfo() - Get full damage information
    • getDamageSource() - Get damage source (EntitySource, ProjectileSource, etc.)
    • getEnvironmentType() - Get environment type if killed by environment
  • Automatic name resolution - Extracts player usernames and NPC role names automatically
  • NPC role names - Returns actual NPC types (e.g., "Cow", "Skeleton_Fighter", "Deer_Doe")
  • ECS integration - Uses DeathComponent additions to detect deaths

Changes

EcsEventHelper - Player Entity Access

  • ENHANCED: Added player entity parameter to block event callbacks
  • onBlockBreak(world, callback) - Now has overload with Entity playerEntity parameter
  • onBlockPlace(world, callback) - Now has overload with Entity playerEntity parameter
  • onBlockDamage(world, callback) - Now has overload with Entity playerEntity parameter
  • Benefits:
    • Identify which player broke/placed/damaged blocks
    • Access player stats directly in event callbacks
    • Apply stat changes based on block interactions
    • Check player permissions for block actions
    • Track player-specific statistics
    • Send messages to specific players
  • Backward compatible - Original callbacks without player entity still work

EventHelper - Item Event Player Entity Access

  • ENHANCED: Added player entity parameter to item event callbacks
  • onItemDrop(plugin, callback) - Now has overload with Entity playerEntity parameter
  • onItemPickup(plugin, callback) - Now has overload with Entity playerEntity parameter
  • onCraftRecipe(plugin, callback) - Now has overload with Entity playerEntity parameter
  • Benefits:
    • Identify which player dropped/picked up/crafted items
    • Access player stats directly in event callbacks
    • Apply stat changes based on item actions (e.g., gain mana on pickup)
    • Check player permissions for item actions
    • Track player-specific item statistics
    • Send targeted messages to specific players
  • Backward compatible - Original callbacks without player entity still work

EquipmentHelper - Equipment Change Cancellation

  • NEW: Cancel equipment changes to prevent equipping/unequipping specific items
  • EquipmentChange.setCancelled(true) - Cancel the equipment change
  • EquipmentChange.isCancelled() - Check if change was cancelled
  • Automatic reversion - Cancelled changes restore old item to equipment slot and return new item to source inventory
  • Preserves item data - Returns items to exact original slots, preserving durability, metadata, and damage