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

  • R
  • Jan 20, 2026
  • 151.44 KB
  • 409
  • Early Access

File Name

HYTALEDEVLIB-0.4.0.jar

Supported Versions

  • Early Access

Version 0.4.0

New Features

ParticleHelper - Particle Effect System

  • NEW: Simplified particle spawning system with access to 535+ particle effects
  • spawnParticle(world, particleId, position) - Spawn particle at position
  • spawnParticle(world, particleId, position, scale) - Spawn with custom scale
  • spawnParticleAtBlock(world, particleId, blockPos) - Spawn at block position
  • spawnParticleAtEntity(world, particleId, entity) - Spawn at entity position
  • spawnParticleAtEntityFeet(world, particleId, entity) - Spawn at entity's feet
  • spawnParticleForPlayer(world, particleId, position, player) - Visible to specific player only

SoundHelper - Sound Effect System

  • NEW: Simplified sound playback system with 2D and 3D audio support
  • 2D Sounds (UI/Global):
    • playSound2D(world, soundId) - Play UI sound to all players
    • playSound2D(world, soundId, volume, pitch) - With custom volume/pitch
    • playSound2DToPlayer(world, soundId, player) - Play to specific player
  • 3D Sounds (Positional):
    • playSound3D(world, soundId, position) - Play at world position
    • playSound3D(world, soundId, position, volume, pitch) - With custom volume/pitch
    • playSound3DAtBlock(world, soundId, blockPos) - Play at block position
    • playSound3DAtEntity(world, soundId, entity) - Play at entity position
    • playSound3DToPlayer(world, soundId, position, player) - Play to specific player only
  • Sound categories - SFX, MUSIC, AMBIENT, VOICE, MASTER
  • Volume and pitch control - Customize playback (1.0 = normal)
  • Automatic distance attenuation - 3D sounds fade with distance

ContainerHelper - Transaction Cancellation

  • NEW: Cancel container transactions to prevent item changes
  • ContainerTransaction.setCancelled(true) - Cancel the transaction
  • ContainerTransaction.isCancelled() - Check if transaction was cancelled
  • Automatic reversion - Cancelled transactions restore BOTH container and player inventory to previous state
  • Preserves item data - Returns items to exact original slots with all metadata

EcsEventHelper - Block Health Write Access (Mining Speed Multipliers)

  • ENHANCED: onBlockDamage(world, callback) overload with BlockDamageContext for read/write access to block health
  • BlockDamageContext class - Comprehensive context object with block health manipulation
    • Read methods:
      • getBlockHealth() - Current block health (0.0 to 1.0)
      • getPosition() - Block position
      • getBlockTypeId() - Block type ID
      • getGatherType() - Block gather type (e.g., "Rocks", "Woods", "Soils", "SoftBlocks")
      • getPlayerEntity() - Player entity
      • getCurrentDamage(), getDamage(), getItemInHand(), getWorld()
    • Write methods:
      • setBlockHealth(float) - Set health directly (0.0 = destroyed, 1.0 = full)
      • applyDamage(float) - Apply additional damage
      • repairBlock(float) - Repair the block
      • setMiningSpeedMultiplier(float) - Multiply mining speed (2.0 = 2x faster)
  • Gather type filtering - Filter blocks by category instead of specific IDs
    • Works with ALL blocks of the same type (e.g., all rocks, all woods)
    • Matches Hytale's tool system (pickaxe for rocks, axe for woods, etc.)
    • Available types: "Rocks", "Woods", "Soils", "SoftBlocks", "Benches", "VolcanicRocks"

PlayerHelper - Game Mode Switching

  • NEW: setGameMode(world, entity, gameMode) - Change a player's game mode programmatically
  • Proper integration - Uses Hytale's internal Player.setGameMode() method
  • Event-driven - Fires ChangeGameModeEvent (can be cancelled by other plugins)
  • Complete sync - Updates movement manager, sends packets to client, runs switch handlers
  • Available modes:
    • GameMode.valueOf("Creative") - Creative mode (fly, no damage, instant break)
    • GameMode.valueOf("Adventure") - Adventure mode (normal gameplay)

EcsEventHelper - Game Mode Change Event

  • NEW: onGameModeChange(world, callback) - Track when players change game modes
  • Cancellable event - Can prevent game mode changes
  • Callback parameters: Player entity and new GameMode

EcsEventHelper - Player Entity Access for Block Interaction and Zone Discovery

  • ENHANCED: Added player entity parameter to block interaction and zone discovery callbacks
  • onBlockInteract(world, callback) - Now has overload with Entity playerEntity parameter
  • onZoneDiscovery(world, callback) - Now has overload with Entity playerEntity parameter
  • Benefits:
    • Identify which player interacted with blocks
    • Identify which player discovered zones
    • Access player stats directly in event callbacks
    • Send targeted messages to specific players
    • Check player permissions for interactions
    • Track player-specific statistics
  • Backward compatible - Original callbacks without player entity still work

PlayerHelper - Block Targeting System

  • NEW: Get the block a player is looking at with distance information
  • getLookingAt(world, entity, checkDistance) - Get target block within specified distance
  • getLookingAt(world, entity) - Get target block with default 5 block distance
  • LookingAtResult class - Comprehensive result object with helper methods
    • getBlockPosition() - Returns Vector3i position of the block
    • getBlockType() - Returns BlockType object
    • getBlockId() - Returns block ID string (e.g., "Rock_Stone")
    • getDistance() - Returns distance to the block
    • hasBlock() - Returns true if a block was found