class Rosegold::TextComponent

Included Modules

Defined in:

rosegold/models/text_component.cr

Constant Summary

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

Constructors

Instance Method Summary

Constructor Detail

def self.from_nbt(nbt : Minecraft::NBT::Tag) : TextComponent #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(text : String | Nil = nil) #

[View source]
def self.read(io : Minecraft::IO) : TextComponent #

[View source]

Instance Method Detail

def block : String | Nil #

[View source]
def block=(block : String | Nil) #

[View source]
def bold : Bool | Nil #

[View source]
def bold=(bold : Bool | Nil) #

[View source]
def click_event : ClickEventComponent | Nil #

[View source]
def click_event=(click_event : ClickEventComponent | Nil) #

[View source]
def color : String | Nil #

Formatting fields


[View source]
def color=(color : String | Nil) #

Formatting fields


[View source]
def entity : String | Nil #

[View source]
def entity=(entity : String | Nil) #

[View source]
def extra : Array(TextComponent) | Nil #

Child components


[View source]
def extra=(extra : Array(TextComponent) | Nil) #

Child components


[View source]
def font : String | Nil #

[View source]
def font=(font : String | Nil) #

[View source]
def hover_event : HoverEventComponent | Nil #

[View source]
def hover_event=(hover_event : HoverEventComponent | Nil) #

[View source]
def insertion : String | Nil #

Interactive fields


[View source]
def insertion=(insertion : String | Nil) #

Interactive fields


[View source]
def interpret : Bool | Nil #

[View source]
def interpret=(interpret : Bool | Nil) #

[View source]
def italic : Bool | Nil #

[View source]
def italic=(italic : Bool | Nil) #

[View source]
def keybind : String | Nil #

[View source]
def keybind=(keybind : String | Nil) #

[View source]
def nbt : String | Nil #

[View source]
def nbt=(nbt : String | Nil) #

[View source]
def obfuscated : Bool | Nil #

[View source]
def obfuscated=(obfuscated : Bool | Nil) #

[View source]
def score : ScoreComponent | Nil #

[View source]
def score=(score : ScoreComponent | Nil) #

[View source]
def selector : String | Nil #

[View source]
def selector=(selector : String | Nil) #

[View source]
def separator : TextComponent | Nil #

[View source]
def separator=(separator : TextComponent | Nil) #

[View source]
def shadow_color : Array(Float32) | Nil #

[View source]
def shadow_color=(shadow_color : Array(Float32) | Nil) #

[View source]
def storage : String | Nil #

[View source]
def storage=(storage : String | Nil) #

[View source]
def strikethrough : Bool | Nil #

[View source]
def strikethrough=(strikethrough : Bool | Nil) #

[View source]
def text : String | Nil #

[View source]
def text=(text : String | Nil) #

[View source]
def to_nbt : Minecraft::NBT::Tag #

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

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>

[View source]
def to_s : String #
Description copied from class Object

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.


[View source]
def translate : String | Nil #

[View source]
def translate=(translate : String | Nil) #

[View source]
def type : String | Nil #

Core content fields


[View source]
def type=(type : String | Nil) #

Core content fields


[View source]
def underlined : Bool | Nil #

[View source]
def underlined=(underlined : Bool | Nil) #

[View source]
def with : Array(TextComponent | String) | Nil #

[View source]
def with=(with __arg0 : Array(TextComponent | String) | Nil) #

[View source]