PlayerScoreEntry .java

net.minecraft.world.scores.PlayerScoreEntry (record, 22 lines): members: owner, value, display, numberFormatOverride, ownerName, formatValue, isHidden.

net.minecraft.world.scoresrecord22 linescommon743 B

API Surface (4)

record PlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride)
boolean isHidden()
Component ownerName()
MutableComponent formatValue(final NumberFormat _default)

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

PlayerScoreEntry.java22 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.scores;
2
3
import java.util.Objects;
4
import net.minecraft.network.chat.Component;
5
import net.minecraft.network.chat.MutableComponent;
6
import net.minecraft.network.chat.numbers.NumberFormat;
7
import org.jspecify.annotations.Nullable;
8
9
public record PlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride) {
10
	public boolean isHidden() {
11
		return this.owner.startsWith("#");
12
	}
13
14
	public Component ownerName() {
15
		return this.display != null ? this.display : Component.literal(this.owner());
16
	}
17
18
	public MutableComponent formatValue(final NumberFormat _default) {
19
		return Objects.requireNonNullElse(this.numberFormatOverride, _default).format(this.value);
20
	}
21
}
22

Decompiled Minecraft 26.3 source of PlayerScoreEntry (net/minecraft/world/scores/PlayerScoreEntry.java) with Mojang official mappings, stored verbatim on the site.