Package net.minecraft.text
Record Class ScoreTextContent
java.lang.Object
java.lang.Record
net.minecraft.text.ScoreTextContent
- Record Components:
name-objective-
- All Implemented Interfaces:
TextContent
public record ScoreTextContent(com.mojang.datafixers.util.Either<ParsedSelector,String> name, String objective)
extends Record
implements TextContent
- Mappings:
Namespace Name named net/minecraft/text/ScoreTextContentintermediary net/minecraft/class_2578official yonamed nameintermediary comp_3078official dnamed objectiveintermediary comp_3079official e
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.TextContent
TextContent.Type<T extends TextContent> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ScoreTextContent> static final com.mojang.serialization.MapCodec<ScoreTextContent> private final com.mojang.datafixers.util.Either<ParsedSelector, String> The field for thenamerecord component.private final StringThe field for theobjectiverecord component.static final TextContent.Type<ScoreTextContent> -
Constructor Summary
ConstructorsConstructorDescriptionScoreTextContent(com.mojang.datafixers.util.Either<ParsedSelector, String> either, String objective) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.private MutableTextgetScore(ScoreHolder scoreHolder, ServerCommandSource source) private ScoreHoldergetScoreHolder(ServerCommandSource source) getType()final inthashCode()Returns a hash code value for this object.com.mojang.datafixers.util.Either<ParsedSelector, String> name()Returns the value of thenamerecord component.Returns the value of theobjectiverecord component.parse(@Nullable ServerCommandSource source, @Nullable Entity sender, int depth) Parses this content into a basic mutable text without custom style or siblings.toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.text.TextContent
visit, visit
-
Field Details
-
name
The field for thenamerecord component. -
objective
The field for theobjectiverecord component. -
INNER_CODEC
- Mappings:
Namespace Name Mixin selector named INNER_CODECLnet/minecraft/text/ScoreTextContent;INNER_CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46626Lnet/minecraft/class_2578;field_46626:Lcom/mojang/serialization/MapCodec;official aLyo;a:Lcom/mojang/serialization/MapCodec;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/text/ScoreTextContent;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46627Lnet/minecraft/class_2578;field_46627:Lcom/mojang/serialization/MapCodec;official bLyo;b:Lcom/mojang/serialization/MapCodec;
-
TYPE
- Mappings:
Namespace Name Mixin selector named TYPELnet/minecraft/text/ScoreTextContent;TYPE:Lnet/minecraft/text/TextContent$Type;intermediary field_46628Lnet/minecraft/class_2578;field_46628:Lnet/minecraft/class_7417$class_8823;official cLyo;c:Lxh$a;
-
-
Constructor Details
-
ScoreTextContent
public ScoreTextContent(com.mojang.datafixers.util.Either<ParsedSelector, String> either, String objective) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/text/ScoreTextContent;<init>(Lcom/mojang/datafixers/util/Either;Ljava/lang/String;)Vintermediary <init>Lnet/minecraft/class_2578;<init>(Lcom/mojang/datafixers/util/Either;Ljava/lang/String;)Vofficial <init>Lyo;<init>(Lcom/mojang/datafixers/util/Either;Ljava/lang/String;)V
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceTextContent- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/text/TextContent;getType()Lnet/minecraft/text/TextContent$Type;intermediary method_54163Lnet/minecraft/class_7417;method_54163()Lnet/minecraft/class_7417$class_8823;official aLxh;a()Lxh$a;
-
getScoreHolder
private ScoreHolder getScoreHolder(ServerCommandSource source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector named getScoreHolderLnet/minecraft/text/ScoreTextContent;getScoreHolder(Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/scoreboard/ScoreHolder;intermediary method_27699Lnet/minecraft/class_2578;method_27699(Lnet/minecraft/class_2168;)Lnet/minecraft/class_9015;official aLyo;a(Lek;)Lfhg;
-
getScore
- Mappings:
Namespace Name Mixin selector named getScoreLnet/minecraft/text/ScoreTextContent;getScore(Lnet/minecraft/scoreboard/ScoreHolder;Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/text/MutableText;intermediary method_27700Lnet/minecraft/class_2578;method_27700(Lnet/minecraft/class_9015;Lnet/minecraft/class_2168;)Lnet/minecraft/class_5250;official aLyo;a(Lfhg;Lek;)Lxu;
-
parse
public MutableText parse(@Nullable @Nullable ServerCommandSource source, @Nullable @Nullable Entity sender, int depth) throws com.mojang.brigadier.exceptions.CommandSyntaxException Parses this content into a basic mutable text without custom style or siblings. The resulting text may or may not have this content.- Specified by:
parsein interfaceTextContent- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector named parseLnet/minecraft/text/TextContent;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;intermediary method_10890Lnet/minecraft/class_7417;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;official aLxh;a(Lek;Lbxe;I)Lxu;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
objective
Returns the value of theobjectiverecord component.- Returns:
- the value of the
objectiverecord component
-