-
Notifications
You must be signed in to change notification settings - Fork 0
TextDisplay
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
Creates floating text holograms using Minecraft's TextDisplay entity.
SpawnedDisplay display = DisplayAPI.text(location)
.text(Component.text("Hello!").color(NamedTextColor.GOLD))
.spawn();Sets the display text using Adventure Component API.
.text(Component.text("Colored text").color(NamedTextColor.RED))
// Multi-line
.text(Component.text("Line 1\nLine 2\nLine 3"))
// Styled
.text(Component.text("Bold!").decorate(TextDecoration.BOLD))Shorthand for plain text.
.text("Simple text")Sets the background color (ARGB).
.background(Color.fromARGB(128, 0, 0, 0)) // Semi-transparent black
.background(Color.fromARGB(200, 255, 0, 0)) // Red with alphaSets background with separate RGBA values.
.background(0, 0, 0, 128) // Semi-transparent blackMakes the background fully transparent.
.noBackground() // No background at allSets text opacity (0 = invisible, 255 = fully visible).
.opacity(128) // 50% transparentEnables text shadow (like Minecraft's text rendering).
.shadowed(true)Makes text visible through blocks.
.seeThrough(true)Text alignment: CENTER, LEFT, RIGHT.
.alignment(TextAlignment.LEFT)Maximum line width before wrapping (default: 200).
.lineWidth(100) // Narrower text wrappingDisplayAPI.text(location)
.text(Component.text("Welcome!")
.color(NamedTextColor.GOLD)
.decorate(TextDecoration.BOLD))
.noBackground()
.shadowed(true)
.billboard(Billboard.CENTER)
.spawn();DisplayAPI.text(location)
.text(Component.text("Rules:\n1. Be kind\n2. No griefing\n3. Have fun!")
.color(NamedTextColor.WHITE))
.background(0, 0, 0, 180)
.alignment(TextAlignment.LEFT)
.lineWidth(150)
.billboard(Billboard.FIXED)
.spawn();DisplayAPI.text(location)
.text(Component.text("IMPORTANT!").color(NamedTextColor.RED))
.noBackground()
.glow(Color.RED)
.spawn();See also: Common-Properties for shared builder options.