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/ScoreTextContent
intermediary net/minecraft/class_2578
official zd
named name
intermediary comp_3078
official d
named objective
intermediary comp_3079
official e
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.TextContent
TextContent.Type<T extends TextContent>
-
Field Summary
Modifier 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 thename
record component.private final String
The field for theobjective
record component.static final TextContent.Type
<ScoreTextContent> -
Constructor Summary
ConstructorDescriptionScoreTextContent
(com.mojang.datafixers.util.Either<ParsedSelector, String> either, String objective) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.private MutableText
getScore
(ScoreHolder scoreHolder, ServerCommandSource source) private ScoreHolder
getScoreHolder
(ServerCommandSource source) getType()
final int
hashCode()
Returns a hash code value for this object.com.mojang.datafixers.util.Either
<ParsedSelector, String> name()
Returns the value of thename
record component.Returns the value of theobjective
record 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, wait
Methods inherited from interface net.minecraft.text.TextContent
visit, visit
-
Field Details
-
name
The field for thename
record component. -
objective
The field for theobjective
record component. -
INNER_CODEC
- Mappings:
Namespace Name Mixin selector named INNER_CODEC
Lnet/minecraft/text/ScoreTextContent;INNER_CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46626
Lnet/minecraft/class_2578;field_46626:Lcom/mojang/serialization/MapCodec;
official a
Lzd;a:Lcom/mojang/serialization/MapCodec;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/text/ScoreTextContent;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46627
Lnet/minecraft/class_2578;field_46627:Lcom/mojang/serialization/MapCodec;
official b
Lzd;b:Lcom/mojang/serialization/MapCodec;
-
TYPE
- Mappings:
Namespace Name Mixin selector named TYPE
Lnet/minecraft/text/ScoreTextContent;TYPE:Lnet/minecraft/text/TextContent$Type;
intermediary field_46628
Lnet/minecraft/class_2578;field_46628:Lnet/minecraft/class_7417$class_8823;
official c
Lzd;c:Lxw$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;)V
intermediary <init>
Lnet/minecraft/class_2578;<init>(Lcom/mojang/datafixers/util/Either;Ljava/lang/String;)V
official <init>
Lzd;<init>(Lcom/mojang/datafixers/util/Either;Ljava/lang/String;)V
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceTextContent
- Mappings:
Namespace Name Mixin selector named getType
Lnet/minecraft/text/TextContent;getType()Lnet/minecraft/text/TextContent$Type;
intermediary method_54163
Lnet/minecraft/class_7417;method_54163()Lnet/minecraft/class_7417$class_8823;
official a
Lxw;a()Lxw$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 getScoreHolder
Lnet/minecraft/text/ScoreTextContent;getScoreHolder(Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/scoreboard/ScoreHolder;
intermediary method_27699
Lnet/minecraft/class_2578;method_27699(Lnet/minecraft/class_2168;)Lnet/minecraft/class_9015;
official a
Lzd;a(Lew;)Lfdb;
-
getScore
- Mappings:
Namespace Name Mixin selector named getScore
Lnet/minecraft/text/ScoreTextContent;getScore(Lnet/minecraft/scoreboard/ScoreHolder;Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/text/MutableText;
intermediary method_27700
Lnet/minecraft/class_2578;method_27700(Lnet/minecraft/class_9015;Lnet/minecraft/class_2168;)Lnet/minecraft/class_5250;
official a
Lzd;a(Lfdb;Lew;)Lyj;
-
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:
parse
in interfaceTextContent
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
- Mappings:
Namespace Name Mixin selector named parse
Lnet/minecraft/text/TextContent;parse(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/entity/Entity;I)Lnet/minecraft/text/MutableText;
intermediary method_10890
Lnet/minecraft/class_7417;method_10890(Lnet/minecraft/class_2168;Lnet/minecraft/class_1297;I)Lnet/minecraft/class_5250;
official a
Lxw;a(Lew;Lbvj;I)Lyj;
-
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 thename
record component.- Returns:
- the value of the
name
record component
-
objective
Returns the value of theobjective
record component.- Returns:
- the value of the
objective
record component
-