public final class ScoreComponent extends BaseComponent
| Constructor and Description |
|---|
ScoreComponent(ScoreComponent original)
Creates a score component from the original to clone it.
|
ScoreComponent(String name,
String objective)
Creates a new score component with the specified name and objective.
If not specifically set, value will default to an empty string; signifying that the scoreboard value should take precedence. |
ScoreComponent(String name,
String objective,
String value) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(Object other) |
ScoreComponent |
duplicate()
Clones the BaseComponent and returns the clone.
|
boolean |
equals(Object o) |
String |
getName()
The name of the entity whose score should be displayed.
|
String |
getObjective()
The internal name of the objective the score is attached to.
|
String |
getValue()
The optional value to use instead of the one present in the Scoreboard.
|
int |
hashCode() |
void |
setName(String name)
The name of the entity whose score should be displayed.
|
void |
setObjective(String objective)
The internal name of the objective the score is attached to.
|
void |
setValue(String value)
The optional value to use instead of the one present in the Scoreboard.
|
protected void |
toLegacyText(StringBuilder builder) |
protected void |
toPlainText(StringBuilder builder) |
String |
toString() |
addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getClickEvent, getColor, getColorRaw, getExtra, getFont, getFontRaw, getHoverEvent, getInsertion, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setFont, setHoverEvent, setInsertion, setItalic, setObfuscated, setStrikethrough, setUnderlined, toLegacyText, toLegacyText, toPlainText, toPlainTextpublic ScoreComponent(String name, String objective)
value will override any value found in the
scoreboard.name - the name of the entity, or an entity selector, whose score
should be displayedobjective - the internal name of the objective the entity's score is
attached topublic ScoreComponent(ScoreComponent original)
original - the original for the new score componentpublic ScoreComponent duplicate()
BaseComponentduplicate in class BaseComponentprotected void toPlainText(StringBuilder builder)
protected void toLegacyText(StringBuilder builder)
public String getName()
public String getObjective()
public String getValue()
public void setName(String name)
public void setObjective(String objective)
public void setValue(String value)
public String toString()
toString in class BaseComponentpublic boolean equals(Object o)
equals in class BaseComponentprotected boolean canEqual(Object other)
canEqual in class BaseComponentpublic int hashCode()
hashCode in class BaseComponentCopyright © 2015–2021 WaterfallMC. All rights reserved.