class

Rosegold::TextComponent

Inherits JSON::Serializable / Reference / Object

Constants

TRANSLATIONS = Hash(String, String).from_json(Rosegold.read_game_asset("1.21.11/language.json"))

Constructors

from_nbt(nbt : Minecraft::NBT::Tag) : TextComponent
Source
new(pull : JSON::PullParser)
Source
new(text : String | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
read(io : Minecraft::IO) : TextComponent
Source

Instance methods

block
Source
block=(block : String | Nil)
Source
bold
Source
bold=(bold : Bool | Nil)
Source
click_event
Source
click_event=(click_event : ClickEventComponent | Nil)
Source
color

Formatting fields

Source
color=(color : String | Nil)

Formatting fields

Source
entity
Source
entity=(entity : String | Nil)
Source
extra

Child components

Source
extra=(extra : Array(TextComponent) | Nil)

Child components

Source
fallback
Source
fallback=(fallback : String | Nil)
Source
font
Source
font=(font : String | Nil)
Source
hover_event
Source
hover_event=(hover_event : HoverEventComponent | Nil)
Source
insertion

Interactive fields

Source
insertion=(insertion : String | Nil)

Interactive fields

Source
interpret
Source
interpret=(interpret : Bool | Nil)
Source
italic
Source
italic=(italic : Bool | Nil)
Source
keybind
Source
keybind=(keybind : String | Nil)
Source
nbt=(nbt : String | Nil)
Source
obfuscated
Source
obfuscated=(obfuscated : Bool | Nil)
Source
score
Source
score=(score : ScoreComponent | Nil)
Source
selector
Source
selector=(selector : String | Nil)
Source
separator
Source
separator=(separator : TextComponent | Nil)
Source
shadow_color
Source
shadow_color=(shadow_color : Int32 | Nil)
Source
storage
Source
storage=(storage : String | Nil)
Source
strikethrough
Source
strikethrough=(strikethrough : Bool | Nil)
Source
text
Source
text=(text : String | Nil)
Source
to_nbt
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
translate
Source
translate=(translate : String | Nil)
Source
type

Core content fields

Source
type=(type : String | Nil)

Core content fields

Source
underlined
Source
underlined=(underlined : Bool | Nil)
Source
with
Source
with=(with __arg0 : Array(TextComponent | String) | Nil)
Source
write(io : Minecraft::IO) : Nil
Source

Nested types