Skip to content

ChatHudLineHelper ​

com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper

Wraps a chat HUD history entry, exposing its text and creation tick and allowing removal from the HUD scrollback. History access is provided by Chat.getHistory().

js
const history = Chat.getHistory();  
const lines = history.getRecvLines();  
Chat.log(`${lines.size()} line(s) in the scrollback`);  
// the list is newest first, so index zero is the line that just arrived
for (let i = 0; i !== lines.size(); i += 1) {
 const line = lines.get(i);  
 Chat.log(`[${line.getCreationTick()}] ${line.getText().getString()}`);  
}

Constructors ​

new ChatHudLineHelper ​

new ChatHudLineHelper(GuiMessage base, ChatComponent hud)#
Stores the chat history message and HUD used by deleteById().

Parameters:

  • base: raw chat history message to wrap
  • hud: chat HUD used by deleteById() to remove the captured message

Methods ​

deleteById ​

deleteById(): ChatHudLineHelper#
Removes this message from the HUD scrollback by value. Removing an absent message has no effect.
Returns: self for chaining.

getCreationTick ​

getCreationTick(): int#
Returns the tick count recorded when the message arrived, not a timestamp.
Returns: the recorded tick count

getText ​

getText(): TextHelper#
Returns this message's styled content.
Returns: the text of this chat line

toString ​

toString(): String#
Returns a diagnostic representation containing the message's plain content and creation tick count.
Returns: diagnostic representation of this chat history entry