FakeText

public interface FakeText

A fake text entity that displays text to players using packet-based entities. Automatically uses TextDisplay for Java Edition players and ArmorStand for Bedrock Edition players.

TextDisplay features (like background color, alignment, billboard mode) are only applied when the viewer is on Java Edition. Bedrock players see a simple armor stand with custom name.

Types

Link copied to clipboard
public interface Builder
Builder for creating FakeText instances with custom styling.
Link copied to clipboard
public enum TextAlignment
Text alignment options for TextDisplay.

Functions

Link copied to clipboard
public void attachTo(Entity vehicle)
Attaches this fake text to an entity with automatic visibility tracking.
Link copied to clipboard
public void detach()
Detaches this fake text from its vehicle and stops automatic tracking.
Link copied to clipboard
public void dismount()
Dismounts this fake text from any vehicle it's currently riding.
Link copied to clipboard
public abstract void displayTo(UUID uuid)
Displays this fake text to a player by UUID.
public abstract void displayTo(Player player)
Displays this fake text to a player.
Link copied to clipboard
public abstract Location getLocation()
Gets the current location of this fake text.
Link copied to clipboard
public abstract String getText()
Gets the current display text.
Link copied to clipboard
public Entity getVehicle()
Gets the vehicle entity this fake text is attached to, if any.
Link copied to clipboard
public abstract boolean hasViewers()
Checks if this fake text has any viewers.
Link copied to clipboard
public abstract void hideFrom(UUID uuid)
Hides this fake text from a player by UUID.
public abstract void hideFrom(Player player)
Hides this fake text from a player.
Link copied to clipboard
public boolean isAutoTracked()
Checks if this fake text is using automatic tracking via attachTo().
Link copied to clipboard
public void mountTo(Entity vehicle)
Makes this fake text ride on top of an entity.
Link copied to clipboard
public abstract void remove()
Removes this fake text from all viewers and cleans up resources.
Link copied to clipboard
public void setBackgroundColor(int argb)
Sets the background color with alpha (TextDisplay only).
public void setBackgroundColor(Color color)
Sets the background color (TextDisplay only).
Link copied to clipboard
public void setBillboard(Display.Billboard billboard)
Sets the billboard mode (TextDisplay only).
Link copied to clipboard
public void setScale(float scale)
Sets the scale of the text (TextDisplay only).
Link copied to clipboard
public void setSeeThrough(boolean seeThrough)
Sets whether the text is see-through (TextDisplay only).
Link copied to clipboard
public void setShadowed(boolean shadow)
Sets whether the text has shadow (TextDisplay only).
Link copied to clipboard
public abstract void setText(String text)
Sets the text to display.
Link copied to clipboard
public void setTextOpacity(byte opacity)
Sets the text opacity (TextDisplay only).
Link copied to clipboard
public abstract void setVisible(boolean visible)
Sets whether the text is visible.
Link copied to clipboard
public abstract void teleport(Location location)
Teleports this fake text to a new location.