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.0.jar

  • R
  • Jan 18, 2026
  • 97.00 KB
  • 61
  • Early Access

File Name

HYTALEDEVLIB-0.3.0.jar

Supported Versions

  • Early Access

Version 0.3.0

New Features

LootHelper - Custom Block Drops System

  • NEW: Complete loot table system for customizing block drops
  • registerBlockLoot(world, blockTypeId, lootProvider) - Add bonus drops alongside default drops
  • registerBlockLootReplacement(world, blockTypeId, lootProvider) - Replace default drops entirely
  • clearLootTables(world) - Clear all custom loot tables for a world
  • ItemDrop class - Represents item drops with quantity and velocity
    • ItemDrop(itemId, quantity) - Create drop with default velocity
    • ItemDrop(itemId, quantity, velocity) - Create drop with custom velocity
    • ItemDrop.withRandomVelocity(itemId, quantity) - Create drop with random spread
  • Physical item entities - Spawns actual item entities in the world with proper physics
  • ECS integration - Uses CommandBuffer for proper entity spawning from ECS systems
  • Flexible loot logic - Support for percentage-based drops, weighted selection, depth-based drops, and complex conditions

ContainerHelper - Container Change Tracking

  • NEW: Track item changes in specific containers (chests, furnaces, etc.)
  • ContainerTransaction API - Automatic transaction parsing with clean API
    • ContainerTransaction class with getAction(), getItemId(), getQuantity(), getRawTransaction()
    • Helper methods: isAdded(), isRemoved(), isMoved(), isSet()
    • Correct shift-click detection - Properly detects ADDED vs REMOVED for shift-click transfers using moveType
    • No manual parsing needed - All callbacks receive parsed ContainerTransaction objects
  • Auto-Registration System - Automatically track ALL containers as they're placed/destroyed
    • enableAutoTracking(world, callback) - Auto-track all containers in world with parsed transactions
    • enableAutoTrackingSimple(world, callback) - Simplified auto-tracking with raw transaction strings
    • disableAutoTracking(world) - Disable auto-tracking
    • isAutoTrackingEnabled(world) - Check if auto-tracking is active
    • addContainerType(blockTypeId) - Add custom container types to auto-track
    • Uses EcsEventHelper to detect container placement and destruction
    • Automatic cleanup - Containers are automatically unregistered when broken
    • Automatically registers/unregisters containers with 2-tick delay for block state creation
  • Manual Registration Methods (with automatic parsing)
    • onContainerChange(world, position, callback) - Track all container changes with parsed transactions
    • onContainerChangeRaw(world, position, callback) - Raw container and event objects
    • onContainerChangeSimple(world, position, callback) - Raw transaction string callback
    • onContainerItemAdd(world, position, callback) - Only track when items are added (parsed)
    • onContainerItemRemove(world, position, callback) - Only track when items are removed (parsed)
    • Manual cleanup required - Use unregisterContainer() when containers are broken (interaction-based registration)
  • Management Methods
    • unregisterContainer(world, position) - Stop tracking a container
    • clearWorld(world) - Clear all tracked containers in a world
    • getTrackedContainerCount(world) - Get number of tracked containers
  • Position-based tracking - Register listeners for specific container locations
  • Event filtering - Separate callbacks for different transaction types
  • Use cases - Chest protection, item logging, automated inventory management, server-wide monitoring
  • 64 container types supported - All chests (workbenches and furnaces are WIP)

EquipmentHelper - Equipment Change Tracking

  • NEW: Track equipment changes for any LivingEntity (armor, utility/offhand, tools)
  • Provides EquipmentChange with:
    • Slot type and slot index
    • Old/new ItemStack
    • Convenience helpers: isEquipping(), isUnequipping(), getOldItemId(), getNewItemId()