TextComponent class

Inheritance

Constructors

TextComponent(String text, {Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
In Minecraft text in the chat or as title is defined with JSON-data. objD makes the JSON part of it easier by utilizing the TextComponent Class:
TextComponent.blockNbt(Location location, {required String path, bool? interpret, Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.blockNbt Location a location of a block path the path as a String interpret bool if nbt should be interpreted as TextComponent(optional) ...same properties... from TextComponent
TextComponent.customFont(String char, {Color? color = Color.White, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.customFont String a Custom Font Character(\uHEX) to insert in your text ...same properties... from TextComponent
TextComponent.entityNbt(Entity entity, {required String path, bool? interpret, Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.entityNbt Entity the entity which has nbt to display path the path as a String interpret bool if nbt should be interpreted as TextComponent(optional) ...same properties... from TextComponent
TextComponent.lineBreak()
This inserts a simple line break
TextComponent.none()
TextComponent.score(Score score, {Color? color, bool? bold, bool? italic, bool? underlined, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.score( Entity.Selected(), objective: 'myscores', color:Color.Black ) ⇒ {'score':{'name': '@s','objective':'myscores'},'color':'black'}
TextComponent.selector(Entity entity, {Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.space(int pixels, {Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
Attention: This requires a custom negative spaces font by AmberW installed(https://cdn.discordapp.com/attachments/157097006500806656/486915349569208322/NegativeSpaceFont3.zip)
TextComponent.storageNbt(String name, {required String path, bool? interpret, Color? color, bool? bold, bool? underlined, bool? italic, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion})
TextComponent.storageNbt String The name of your Storage(including namespace) path the path as a String interpret bool if nbt should be interpreted as TextComponent(optional) ...same properties... from TextComponent
TextComponent.translate(String key, {List? conversionFlags, Color? color, bool? bold, bool? italic, bool? underlined, bool? strikethrough, bool? obfuscated, TextClickEvent? clickEvent, TextHoverEvent? hoverEvent, String? insertion, String? fallback})

Properties

bold bool?
getter/setter pair
clickEvent TextClickEvent?
getter/setter pair
color Color?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hoverEvent TextHoverEvent?
getter/setter pair
insertion String?
getter/setter pair
italic bool?
getter/setter pair
obfuscated bool?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strikethrough bool?
getter/setter pair
underlined bool?
getter/setter pair
value Map<String, dynamic>
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String?
toMap() Map<String, dynamic>?
toSimple() Map<String, dynamic>?
returns a simple, json compatible representation of the content
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited