promotional bannermobile promotional banner

Text Chat Distance

A semi-realistic text chat where the closer you get, the better you understand

This mod makes text chat intelligible, as if the player were speaking.
It affects private chats like /msg and the general server chat.

The TextChatDistanceAPI functions as an automated communication filter. It handles proximity logic by calculating the spatial distance between the source (player or block) and containers.Core Mechanisms:

  • Spatial Calculation: Utilizes distanceToSqr for efficient coordinate-based math, verifying dimension consistency to ensure messages do not bleed across dimensions.
  • Dynamic Obfuscation: Implements a probability-based algorithm for the "Half-Away" range. As a container moves from CloseMax toward HalfAwayMax, a calculated ratio (0.0 to 1.0) determines the likelihood of each character being replaced by a *.
  • Component Integration: Accepts Minecraft Component objects (both literal and translatable). It flattens these into raw strings to perform character-level transformations, then reconstructs them into final components to maintain UI compatibility and bypass network signature restrictions.
  • Abstraction: Centralizes iteration over server-side players and logic validation, requiring only a simple method call (broadcastArea or sendDirectMessage) from other mod components.
  • Integration Requirement: To utilize the API, import net.txd.textchatdistance.api. TextChatDistanceAPI. Use broadcastArea for radial messages originating from an entity or BlockPos, and sendDirectMessage for point-to-point communication. The API consumes these requests, processes the distance against the ChatDistanceManager config, and executes sendSystemMessage internally for all valid recipients, automatically filtering those beyond the HalfAwayMax limit.

The Text Chat Distance Team

profile avatar
Owner
  • 2
    Followers
  • 5
    Projects
  • 11.0K
    Downloads

More from TamoideView all