Skip to content

Class TranslatableContent

Namespace: Void.Minecraft.Components.Text.Properties.Content
Assembly: Void.Minecraft.dll

Represents a text component whose displayed value is resolved from a client translation key.

public record TranslatableContent : IContent, IEquatable<TranslatableContent>

Inheritance

objectTranslatableContent

Implements

IContent, IEquatable<TranslatableContent>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Remarks

Serializers omit Fallback and With when they are null.

Constructors

TranslatableContent(string, string?, IEnumerable<Component>?)

Represents a text component whose displayed value is resolved from a client translation key.

public TranslatableContent(string Translate, string? Fallback = null, IEnumerable<Component>? With = null)

Parameters

Translate string

The translation key written to the component’s translate field.

Fallback string?

Optional literal text used when the client cannot resolve Translate.

With IEnumerable<Component>?

Optional arguments substituted into the translated pattern.

Remarks

Serializers omit Fallback and With when they are null.

Properties

Fallback

Optional literal text used when the client cannot resolve Translate.

public string? Fallback { get; init; }

Property Value

string?

Translate

The translation key written to the component’s translate field.

public string Translate { get; init; }

Property Value

string

Type

public string Type { get; }

Property Value

string

With

Optional arguments substituted into the translated pattern.

public IEnumerable<Component>? With { get; init; }

Property Value

IEnumerable<Component>?