类 ScoreComponent
java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.ScoreComponent
This component displays the score based on a player score on the scoreboard.
The name is the name of the player stored on the scoreboard, which may be a "fake" player. It can also be a target selector that must resolve to 1 target, and may target non-player entities.
With a book, /tellraw, or /title, using the wildcard '*' in the place of a name or target selector will cause all players to see their own score in the specified objective.
Signs cannot use the '*' wildcard
These values are filled in by the server-side implementation.
As of 1.12.2, a bug ( MC-56373 ) prevents full usage within hover events.
The name is the name of the player stored on the scoreboard, which may be a "fake" player. It can also be a target selector that must resolve to 1 target, and may target non-player entities.
With a book, /tellraw, or /title, using the wildcard '*' in the place of a name or target selector will cause all players to see their own score in the specified objective.
Signs cannot use the '*' wildcard
These values are filled in by the server-side implementation.
As of 1.12.2, a bug ( MC-56373 ) prevents full usage within hover events.
-
构造器概要
构造器构造器说明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) ScoreComponent
(ScoreComponent original) Creates a score component from the original to clone it. -
方法概要
修饰符和类型方法说明protected boolean
克隆本组件并返回克隆副本.boolean
getName()
The name of the entity whose score should be displayed.The internal name of the objective the score is attached to.getValue()
The optional value to use instead of the one present in the Scoreboard.int
hashCode()
void
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
The optional value to use instead of the one present in the Scoreboard.protected void
toLegacyText
(StringBuilder builder) protected void
toPlainText
(StringBuilder builder) toString()
从类继承的方法 net.md_5.bungee.api.chat.BaseComponent
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, toPlainText
-
构造器详细资料
-
ScoreComponent
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. If not null, nor empty,value
will override any value found in the scoreboard.
The value defaults to an empty string.- 参数:
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 to
-
ScoreComponent
Creates a score component from the original to clone it.- 参数:
original
- the original for the new score component
-
ScoreComponent
-
-
方法详细资料
-
duplicate
从类复制的说明:BaseComponent
克隆本组件并返回克隆副本.原文:Clones the BaseComponent and returns the clone.
- 指定者:
duplicate
在类中BaseComponent
- 返回:
- 该组件的副本
-
toPlainText
-
toLegacyText
-
getName
The name of the entity whose score should be displayed. -
getObjective
The internal name of the objective the score is attached to. -
getValue
The optional value to use instead of the one present in the Scoreboard. -
setName
The name of the entity whose score should be displayed. -
setObjective
The internal name of the objective the score is attached to. -
setValue
The optional value to use instead of the one present in the Scoreboard. -
toString
- 覆盖:
toString
在类中BaseComponent
-
equals
- 覆盖:
equals
在类中BaseComponent
-
canEqual
- 覆盖:
canEqual
在类中BaseComponent
-
hashCode
public int hashCode()- 覆盖:
hashCode
在类中BaseComponent
-