0x3C S3CPacketUpdateScore
Updates a single scoreboard entry (add, remove, or change score value).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| name | String | Score name (player name or team) |
| objectiveName | String | Objective name |
| value | int | Score value |
| action | VarInt Enum | 0=create/update, 1=remove |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Name | String | |
| Objective | String | |
| Value | int | 0 for remove |
| Action | VarInt | 0=create, 1=remove |
MCP References
NetHandlerPlayClient.handleUpdateScore()Handler Interface
INetHandlerPlayClientVanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
Deobfuscated MCP 1.8.9 source of S3CPacketUpdateScore, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S3CPacketUpdateScore.java) at build time and verified present.
Deep Dive
Role in the protocol
Single-row scoreboard mutation. Fields are the score name (40-char cap), an action enum (CHANGE or REMOVE), the objective name (16-char cap), and for CHANGE a VarInt value. The server emits one S3C per row update: value change, row removal, removal scoped to one objective, and full replay during objective creation and on join. It is the most frequently emitted scoreboard packet: a 15-row sidebar refresh is 15 packets.
Vanilla handling
handleUpdateScore resolves the objective by name, then either sets the score points (CHANGE) or removes the row (REMOVE). A REMOVE with an empty objective name removes the row from every objective. The client scoreboard then re-renders whichever slot binds the objective. The value field is only present for CHANGE, so the read path is action-dependent.
Why clients touch it
Two Spicy files rewrite this packet, both for name visibility. HideName replaces the session username with a chosen alias in both the objective name and the row name fields, so sidebar kill feeds and stats boards stop showing the real name. Account.java does the inverse for alt accounts: it appends the real account name in green so the user can tell which identity is live. Both mutate the decoded packet inside EventPacket pre, before the vanilla handler runs. Rise 6.x only registers the class in the script API.
Exploit surface
Name rewriting here is invisible to the server: S3C is clientbound, and the rewrite happens after decode and before the client scoreboard consumes it. Anti-cheats never see the mutation. HideName stays consistent by applying the same alias to chat (S02PacketChat) and scoreboard rows, so the client-side story matches everywhere. There is no server-side state to desync because the scoreboard lives only on the client.
Server-Side Handling
ServerScoreboard emits S3C on score value changes, row removal, and removal scoped to one objective, plus full replays during objective creation and join. All sends go through sendPacketToAllPlayers. The packet is clientbound only; the server never validates or receives score state back from the client.
Protocol Analysis
readPacketData order: score name (40-char cap), action enum via readEnumValue, objective name (16-char cap), then the VarInt value only when the action is CHANGE. REMOVE rows omit the value, keeping the packet short. The enum has exactly two members, CHANGE and REMOVE; there is no separate add action.
Anti-Cheat Landscape
Nothing flags S3C abuse in the corpus. It carries display strings and a display integer, no timing or movement content. Rewriting name fields is purely cosmetic client-side work that server-side anti-cheat cannot detect.
implementation Implementation Cases
The only scoreboard packet the 8 clients actually mutate. Spicy's HideName swaps the player's username for an alias in score rows; Spicy's Account.java appends the real alt name in green. Both rewrite the decoded packet before the vanilla handler, which the server cannot see.
Stop the player's real username from appearing in scoreboard rows: sidebar stats, kill feeds, and per-player objectives.
In EventPacket pre, when the packet is S3CPacketUpdateScore, it strips the invisible joiner character () from both name fields and checks whether the objective name or the score name contains the session username. On a match it replaces the username with the selected alias via setObjective and setName. The same handler rewrites S02PacketChat for chat surfaces.
// ===== FILE: Spicy, info/spicyclient/modules/player/HideName.java =====
package info.spicyclient.modules.player;
import org.lwjgl.input.Keyboard;
import info.spicyclient.SpicyClient;
import info.spicyclient.events.Event;
import info.spicyclient.events.listeners.EventPacket;
import info.spicyclient.events.listeners.EventUpdate;
import info.spicyclient.modules.Module;
import info.spicyclient.settings.ModeSetting;
import info.spicyclient.settings.SettingChangeEvent;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S3BPacketScoreboardObjective;
import net.minecraft.network.play.server.S3CPacketUpdateScore;
import net.minecraft.network.play.server.S3DPacketDisplayScoreboard;
import net.minecraft.util.ChatComponentText;
public class HideName extends Module {
public ModeSetting mode = new ModeSetting("Name", "You", "You", "MooshroomMashUp", "Fox_of_floof", "lavaflowglow", "_Floofy_Fox_");
public HideName() {
super("HideName", Keyboard.KEY_NONE, Category.PLAYER);
resetSettings();
}
@Override
public void resetSettings() {
this.settings.clear();
this.addSettings(mode);
}
@Override
public void onEvent(Event e) {
if (e instanceof EventUpdate && e.isPre()) {
this.additionalInformation = mode.getMode();
}
if (e instanceof EventPacket && e.isPre()) {
EventPacket packetEvent = (EventPacket) e;
if (packetEvent.packet instanceof S02PacketChat) {
S02PacketChat packet = (S02PacketChat) packetEvent.packet;
if (packet.getChatComponent().getUnformattedText().replaceAll("", "").contains(mc.getSession().getUsername())) {
packet.chatComponent = new ChatComponentText(packet.getChatComponent().getFormattedText().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
}
}
else if (packetEvent.packet instanceof S3CPacketUpdateScore) {
S3CPacketUpdateScore packet = (S3CPacketUpdateScore) packetEvent.packet;
if (packet.getObjectiveName().replaceAll("", "").contains(mc.getSession().getUsername())){
packet.setObjective(packet.getObjectiveName().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
}
if (packet.getName().replaceAll("", "").contains(mc.getSession().getUsername())){
packet.setName(packet.getName().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
}
}
}
}
}
// NOTE (AI): The S3CPacketUpdateScore branch on lines 52-63 is the core of this module. It rewrites both the objective name and the score name so the session username never renders in a scoreboard row. The mode setting selects the replacement alias.For alt accounts, append the real account name to the player's own scoreboard rows so the user can tell which identity is live.
Account.onPacket, reached from the module event bus when SpicyClient.account.loggedIn is true, handles S3CPacketUpdateScore by rewriting the objective name and row name, replacing the session username with 'username §f(§a realname §f)'. The same treatment applies to S02PacketChat. It also polls the SpicyClient.info API per player to map alt names to real accounts.
// ===== FILE: Spicy, info/spicyclient/files/Account.java =====
package info.spicyclient.files;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
import info.spicyclient.SpicyClient;
import info.spicyclient.chatCommands.Command;
import info.spicyclient.events.Event;
import info.spicyclient.events.EventType;
import info.spicyclient.events.listeners.EventPacket;
import info.spicyclient.events.listeners.EventRender3D;
import info.spicyclient.events.listeners.EventRenderGUI;
import info.spicyclient.events.listeners.EventUpdate;
import info.spicyclient.modules.player.ChatBypass;
import info.spicyclient.modules.player.HideName;
import info.spicyclient.networking.NetworkManager;
import info.spicyclient.util.Timer;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S0CPacketSpawnPlayer;
import net.minecraft.network.play.server.S3CPacketUpdateScore;
import net.minecraft.util.ChatComponentText;
public class Account {
public static transient HashMap<String, String> usernames = new HashMap<String, String>();
public static transient Timer timer1 = new Timer(), timer2 = new Timer(), timer3 = new Timer();
public String username = "", session = "";
public boolean loggedIn = false;
public static Minecraft mc = Minecraft.getMinecraft();
public void onEvent(Event e) {
if (!SpicyClient.account.loggedIn) {
return;
}
if (e instanceof EventPacket)
onPacket((EventPacket) e);
if (e instanceof EventUpdate)
onUpdate((EventUpdate) e);
}
public void render3DStuff(EventRender3D e) {
}
public void onUpdate(EventUpdate e) {
if (e.isPre() && timer2.hasTimeElapsed(60000, true)) {
}
int players = 20;
if (mc.theWorld.playerEntities.size() <= 10) {
players = 20;
}else {
players = mc.theWorld.playerEntities.size();
}
try {
if (e.isPre() && timer1.hasTimeElapsed(2000 * players, true)) {
for (EntityPlayer player : mc.theWorld.playerEntities) {
new Thread() {
public void run() {
JSONObject json;
try {
//Command.sendPrivateChatMessage(player.getName());
if (usernames.containsKey(player.getName())) {
return;
}
json = new JSONObject(NetworkManager.getNetworkManager().sendPost(new HttpPost("http://SpicyClient.info/api/accountApi.php"), new BasicNameValuePair("type", "checkIfUserIsUsingSpicyClient"), new BasicNameValuePair("username", player.getName())));
if (json.getBoolean("alt")) {
String realUsername = json.getString("username");
usernames.put(player.getName(), realUsername);
}else {
//usernames.put(player.getName(), " - - - - ");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
}
}
} catch (ConcurrentModificationException e2) {
// TODO: handle exception
}
}
public void onPacket(EventPacket e) {
if (e instanceof EventPacket && e.isPre()) {
if (SpicyClient.config.killSults.isEnabled()) {
EventType temp = e.getType();
e.setType(EventType.BEFOREPRE);
SpicyClient.config.killSults.onEvent(e);
e.setType(temp);
}
EventPacket packetEvent = (EventPacket) e;
if (packetEvent.packet instanceof S02PacketChat) {
S02PacketChat packet = (S02PacketChat) packetEvent.packet;
/*
mc.thePlayer.setCustomNameTag(mc.getSession().getUsername() + " §7{§c" + ChatBypass.insertPeriodically(SpicyClient.account.username, "⛍⛗⛌⛗⛘⛉⛡⛍⛗⛉⛍⛘⛜⛍⛠⛘⛟⛏⛡⛏⛗⛏⛍⛉⛋", 1) + "§7} ");
if (packet.getChatComponent().getUnformattedText().replaceAll("", "").contains(mc.getSession().getUsername())) {
packet.chatComponent = new ChatComponentText(packet.getChatComponent().getFormattedText().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mc.getSession().getUsername() + " §7{§a" + ChatBypass.insertPeriodically(SpicyClient.account.username, "⛍⛗⛌⛗⛘⛉⛡⛍⛗⛉⛍⛘⛜⛍⛠⛘⛟⛏⛡⛏⛗⛏⛍⛉⛋", 1) + "§7} "));
}
*/
for (String username : usernames.keySet()) {
if (packet.getChatComponent().getUnformattedText().replaceAll("", "").contains(username) && usernames.get(username) != " - - - - ") {
packet.chatComponent = new ChatComponentText(packet.getChatComponent().getFormattedText().replaceAll("", "").replaceAll(username, username + " §7{§a" + ChatBypass.insertPeriodically(usernames.get(username), "⛍⛗⛌⛗⛘⛉⛡⛍⛗⛉⛍⛘⛜⛍⛠⛘⛟⛏⛡⛏⛗⛏⛍⛉⛋", 1) + "§7} "));
}
}
}
else if (packetEvent.packet instanceof S3CPacketUpdateScore) {
S3CPacketUpdateScore packet = (S3CPacketUpdateScore) packetEvent.packet;
if (packet.getObjectiveName().replaceAll("", "").contains(mc.getSession().getUsername())){
packet.setObjective(packet.getObjectiveName().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mc.getSession().getUsername() + " §f(§a" + SpicyClient.account.username + "§f)"));
}
if (packet.getName().replaceAll("", "").contains(mc.getSession().getUsername())){
packet.setName(packet.getName().replaceAll("", "").replaceAll(mc.getSession().getUsername(), mc.getSession().getUsername() + " §f(§a" + SpicyClient.account.username + "§f)"));
}
}
}
}
}
// NOTE (AI): The S3CPacketUpdateScore branch on lines 154-165 appends the real account username in green to both score name fields. This is a name-reveal feature: the owner of an alt can identify which account is displayed in sidebars and chat.Expose the packet class to Rise's JavaScript scripting API so scripts can construct, read, or match it.
S3CPacketUpdateScore is listed in the clientbound Class array of NetworkAPI.java (line 103). Scripts use the table to instantiate or filter the packet.
// ===== FILE: Rise 6.1.30, com/alan/clients/script/api/NetworkAPI.java =====
package com.alan.clients.script.api;
import com.alan.clients.util.chat.ChatUtil;
import lombok.SneakyThrows;
import net.minecraft.network.EnumPacketDirection;
import net.minecraft.network.Packet;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.network.play.INetHandlerPlayServer;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.*;
import javax.script.ScriptException;
import java.util.Arrays;
public class NetworkAPI extends API {
public final static Class<Packet<INetHandlerPlayServer>>[] serverbound = new Class[]{
C00PacketKeepAlive.class,
C01PacketChatMessage.class,
C02PacketUseEntity.class,
C03PacketPlayer.class,
C03PacketPlayer.C04PacketPlayerPosition.class,
C03PacketPlayer.C05PacketPlayerLook.class,
C03PacketPlayer.C06PacketPlayerPosLook.class,
C07PacketPlayerDigging.class,
C08PacketPlayerBlockPlacement.class,
C09PacketHeldItemChange.class,
C0APacketAnimation.class,
C0BPacketEntityAction.class,
C0CPacketInput.class,
C0DPacketCloseWindow.class,
C0EPacketClickWindow.class,
C0FPacketConfirmTransaction.class,
C10PacketCreativeInventoryAction.class,
C11PacketEnchantItem.class,
C12PacketUpdateSign.class,
C13PacketPlayerAbilities.class,
C14PacketTabComplete.class,
C15PacketClientSettings.class,
C16PacketClientStatus.class,
C17PacketCustomPayload.class,
C18PacketSpectate.class,
C19PacketResourcePackStatus.class,
};
public final static Class<Packet<INetHandlerPlayClient>>[] clientbound = new Class[]{
S00PacketKeepAlive.class,
S01PacketJoinGame.class,
S02PacketChat.class,
S03PacketTimeUpdate.class,
S04PacketEntityEquipment.class,
S05PacketSpawnPosition.class,
S06PacketUpdateHealth.class,
S07PacketRespawn.class,
S08PacketPlayerPosLook.class,
S09PacketHeldItemChange.class,
S0APacketUseBed.class,
S0BPacketAnimation.class,
S0CPacketSpawnPlayer.class,
S0DPacketCollectItem.class,
S0EPacketSpawnObject.class,
S0FPacketSpawnMob.class,
S10PacketSpawnPainting.class,
S11PacketSpawnExperienceOrb.class,
S12PacketEntityVelocity.class,
S13PacketDestroyEntities.class,
S14PacketEntity.class,
S18PacketEntityTeleport.class,
S19PacketEntityHeadLook.class,
S19PacketEntityStatus.class,
S1BPacketEntityAttach.class,
S1CPacketEntityMetadata.class,
S1DPacketEntityEffect.class,
S1EPacketRemoveEntityEffect.class,
S1FPacketSetExperience.class,
S20PacketEntityProperties.class,
S21PacketChunkData.class,
S22PacketMultiBlockChange.class,
S23PacketBlockChange.class,
S24PacketBlockAction.class,
S25PacketBlockBreakAnim.class,
S26PacketMapChunkBulk.class,
S27PacketExplosion.class,
S28PacketEffect.class,
S29PacketSoundEffect.class,
S2APacketParticles.class,
S2BPacketChangeGameState.class,
S2CPacketSpawnGlobalEntity.class,
S2DPacketOpenWindow.class,
S2EPacketCloseWindow.class,
S2FPacketSetSlot.class,
S30PacketWindowItems.class,
S31PacketWindowProperty.class,
S32PacketConfirmTransaction.class,
S33PacketUpdateSign.class,
S34PacketMaps.class,
S35PacketUpdateTileEntity.class,
S36PacketSignEditorOpen.class,
S37PacketStatistics.class,
S38PacketPlayerListItem.class,
S39PacketPlayerAbilities.class,
S3APacketTabComplete.class,
S3BPacketScoreboardObjective.class,
S3CPacketUpdateScore.class,
S3DPacketDisplayScoreboard.class,
S3EPacketTeams.class,
S3FPacketCustomPayload.class,
S40PacketDisconnect.class,
S41PacketServerDifficulty.class,
S42PacketCombatEvent.class,
S43PacketCamera.class,
S44PacketWorldBorder.class,
S45PacketTitle.class,
S46PacketSetCompressionLevel.class,
S47PacketPlayerListHeaderFooter.class,
S48PacketResourcePackSend.class,
S49PacketUpdateEntityNBT.class
};
@SneakyThrows
private static Packet<?> instantiatePacket(final EnumPacketDirection direction, final int id, final Object... params) {
Packet<?> packet = null;
try {
if (direction == EnumPacketDirection.CLIENTBOUND) {
packet = (Packet<?>) Arrays.stream(clientbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
} else if (direction == EnumPacketDirection.SERVERBOUND) {
packet = (Packet<?>) Arrays.stream(serverbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
}
} catch (Exception ex) {
ChatUtil.display("Failed to instantiate packet!");
throw new ScriptException(ex);
}
return packet;
}
public void sendPacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.SERVERBOUND, id, params);
MC.getNetHandler().addToSendQueue(packet);
}
public void receivePacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.CLIENTBOUND, id, params);
MC.getNetHandler().addToReceiveQueue(packet);
}
public boolean isSingleplayer() {
return MC.isSingleplayer();
}
public boolean isMultiplayer() {
return !MC.isSingleplayer() && MC.getCurrentServerData() != null;
}
public String getServerIP() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverIP
: null;
}
public String getServerName() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverName
: null;
}
public String getServerMOTD() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverMOTD
: null;
}
}
// NOTE (AI): The clientbound array lists S3CPacketUpdateScore at line 103. Identical file ships in Rise 6.2.4 under Client-release2/Client/src/main/java.anticheat Anti-Cheat Checks
S3C is the single-row scoreboard mutation, and no anticheat flags it. The only live consumer is Shard's monitor, which renders its status sidebar by emitting the scoreboard family itself, including the S3C row updates. The rest of the corpus is registrations (Negativity PacketType SCOREBOARD_SCORE, Artemis PacketRepository SERVER_PLAY+57 with the PacketPlayServerScoreboardScore wrapper and HardcodeMap) and keyword noise: intave's hits handle the sibling S3E team packet and matched on the Scoreboard search term, NCP's CollisionUtil reads the Bukkit scoreboard API for team collision predicates, and amnoah's ReloadCommand mentions BetterScoreboard in a comment.
The anticheat's own scoreboard HUD: Shard renders its monitor sidebar by sending the client the scoreboard packets itself, including the S3C row updates.
ScoreboardPacketBridge constructs and sends the full scoreboard family to a viewer: WrapperPlayServerScoreboardObjective for the objective (adventure-component title on 1.20.3+ with a legacy fallback), WrapperPlayServerDisplayScoreboard for the slot binding, and WrapperPlayServerUpdateScore for each row, with CREATE_OR_UPDATE_ITEM carrying the score value and REMOVE_ITEM handling deletions on servers below 1.20.3 (WrapperPlayServerResetScore replaces the remove path on 1.20.3+). updateEntry is the S3C producer: one packet per sidebar row per refresh.
// ===== FILE: KaelusAI-Shard, src/main/kotlin/ac/shard/monitor/core/ScoreboardPacketBridge.kt =====
/*
* This file is part of Shard - https://github.com/KaelusAI/Shard
* Copyright (C) 2026 KaelusAI
*
* Shard is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Shard is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ac.shard.monitor.core
import com.github.retrooper.packetevents.PacketEvents
import com.github.retrooper.packetevents.manager.server.ServerVersion
import com.github.retrooper.packetevents.protocol.score.ScoreFormat
import com.github.retrooper.packetevents.wrapper.PacketWrapper
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDisplayScoreboard
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerResetScore
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerScoreboardObjective
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateScore
import java.util.Optional
import net.kyori.adventure.text.Component
import org.bukkit.entity.Player
data class ObjectiveSpec(
val name: String,
val slot: Int,
val title: String,
val legacyTitleFallback: String,
val blankScoreText: String,
)
data class ScoreDisplay(val entryDisplay: String?, val scoreText: String?)
class ScoreboardPacketBridge(private val cache: ComponentCache) {
fun supportsFancyText(viewer: Player): Boolean =
serverSupportsFancyText() && clientVersion(viewer).isNewerThanOrEquals(ServerVersion.V_1_20_3)
fun createObjective(viewer: Player, spec: ObjectiveSpec) {
val fancy = supportsFancyText(viewer)
val title = if (fancy) spec.title else spec.title.ifBlank { spec.legacyTitleFallback }
val create =
if (fancy) {
WrapperPlayServerScoreboardObjective(
spec.name,
WrapperPlayServerScoreboardObjective.ObjectiveMode.CREATE,
cache.component(title),
WrapperPlayServerScoreboardObjective.RenderType.INTEGER,
ScoreFormat.fixedScore(cache.component(spec.blankScoreText)),
)
} else {
WrapperPlayServerScoreboardObjective(
spec.name,
WrapperPlayServerScoreboardObjective.ObjectiveMode.CREATE,
cache.component(title),
WrapperPlayServerScoreboardObjective.RenderType.INTEGER,
)
}
sendPacket(viewer, create)
sendPacket(viewer, WrapperPlayServerDisplayScoreboard(spec.slot, spec.name))
}
fun displayObjective(viewer: Player, name: String, slot: Int) {
sendPacket(viewer, WrapperPlayServerDisplayScoreboard(slot, name))
}
fun removeObjective(viewer: Player, name: String) {
sendPacket(
viewer,
WrapperPlayServerScoreboardObjective(
name,
WrapperPlayServerScoreboardObjective.ObjectiveMode.REMOVE,
Component.empty(),
null,
),
)
}
fun updateEntry(
viewer: Player,
objective: String,
entry: String,
score: Int,
display: ScoreDisplay,
) {
sendPacket(viewer, updateScorePacket(viewer, objective, entry, score, display))
}
fun removeEntry(viewer: Player, objective: String, entry: String) {
val packet =
if (supportsFancyText(viewer)) {
WrapperPlayServerResetScore(entry, objective)
} else {
WrapperPlayServerUpdateScore(
entry,
WrapperPlayServerUpdateScore.Action.REMOVE_ITEM,
objective,
Optional.empty(),
)
}
sendPacket(viewer, packet)
}
private fun updateScorePacket(
viewer: Player,
objective: String,
entry: String,
score: Int,
display: ScoreDisplay,
): PacketWrapper<*> {
if (!supportsFancyText(viewer)) {
return WrapperPlayServerUpdateScore(
entry,
WrapperPlayServerUpdateScore.Action.CREATE_OR_UPDATE_ITEM,
objective,
Optional.of(score),
)
}
val format =
display.scoreText?.let { ScoreFormat.fixedScore(cache.component(it)) }
?: ScoreFormat.blankScore()
return WrapperPlayServerUpdateScore(
entry,
WrapperPlayServerUpdateScore.Action.CREATE_OR_UPDATE_ITEM,
objective,
score,
display.entryDisplay?.let { cache.component(it) },
format,
)
}
fun serverSupportsFancyText(): Boolean =
PacketEvents.getAPI().serverManager.version.isNewerThanOrEquals(ServerVersion.V_1_20_3)
private fun clientVersion(viewer: Player): ServerVersion =
PacketEvents.getAPI().playerManager.getClientVersion(viewer).toServerVersion()
private fun sendPacket(viewer: Player, packet: PacketWrapper<*>) {
PacketEvents.getAPI().playerManager.sendPacket(viewer, packet)
}
}
// NOTE (AI): WrapperPlayServerUpdateScore is the PacketEvents name for S3CPacketUpdateScore. Row removal falls back to the S3C REMOVE path (lines 96-109) for servers below 1.20.3, and the same bridge emits the S3B objective (lines 46-68) and the S3D display binding (line 67) that the monitor sidebar needs.Render chat score components inside the world emulator by substituting the score value for a named objective and entry.
TextComponentScore is the moderna text-component subclass behind the score placeholder. Its resolve path looks up the objective on the emulated world's Bukkit scoreboard and writes score.getScorePoints() into the value (lines 61-77), and getUnformattedComponentText returns that value. The scoreboard lookup is inside a resolve() method that is commented out in the cloned source, so the class never queries the scoreboard at runtime. The corpus hit is the Scoreboard keyword, not the packet: Artemis reads score state through the server API and never parses S3C.
// ===== FILE: artemisac-artemis-minecraft-anticheat, ac.artemis.core/src/main/java/ac/artemis/core/v4/emulator/moderna/text/TextComponentScore.java =====
package ac.artemis.core.v4.emulator.moderna.text;
import ac.artemis.core.v4.emulator.moderna.ITextComponent;
import ac.artemis.core.v4.emulator.moderna.TextComponentBase;
public class TextComponentScore extends TextComponentBase
{
private final String name;
private final String objective;
/** The value displayed instead of the real score (may be null) */
private String value = "";
public TextComponentScore(String nameIn, String objectiveIn)
{
this.name = nameIn;
this.objective = objectiveIn;
}
/**
* Gets the name of the entity who owns this score.
*/
public String getName()
{
return this.name;
}
/**
* Gets the name of the objective for this score.
*/
public String getObjective()
{
return this.objective;
}
/**
* Sets the value that is displayed for the score. Generally, you do not want to call this as the score is resolved
* automatically. (If you want to manually set text, use a {@link TextComponentString})
*/
public void setValue(String valueIn)
{
this.value = valueIn;
}
/**
* Gets the raw content of this component (but not its sibling components), without any formatting codes. For
* example, this is the raw text in a {@link TextComponentString}, but it's the translated text for a {@link
* TextComponentTranslation} and it's the score value for a {@link TextComponentScore}.
*/
public String getUnformattedComponentText()
{
return this.value;
}
/**
* Resolves the value of the score on this component.
*/
/*public void resolve(ICommandSender sender)
{
MinecraftServer minecraftserver = sender.getServer();
if (minecraftserver != null && minecraftserver.isAnvilFileSet() && StringUtils.isNullOrEmpty(this.value))
{
Scoreboard scoreboard = minecraftserver.getWorld(0).getScoreboard();
ScoreObjective scoreobjective = scoreboard.getObjective(this.objective);
if (scoreboard.entityHasObjective(this.name, scoreobjective))
{
Score score = scoreboard.getOrCreateScore(this.name, scoreobjective);
this.setValue(String.format("%d", score.getScorePoints()));
}
else
{
this.value = "";
}
}
}*/
/**
* Creates a copy of this component. Almost a deep copy, except the style is shallow-copied.
*/
public TextComponentScore createCopy()
{
TextComponentScore textcomponentscore = new TextComponentScore(this.name, this.objective);
textcomponentscore.setValue(this.value);
textcomponentscore.setStyle(this.getStyle().createShallowCopy());
for (ITextComponent itextcomponent : this.getSiblings())
{
textcomponentscore.appendSibling(itextcomponent.createCopy());
}
return textcomponentscore;
}
public boolean equals(Object p_equals_1_)
{
if (this == p_equals_1_)
{
return true;
}
else if (!(p_equals_1_ instanceof TextComponentScore))
{
return false;
}
else
{
TextComponentScore textcomponentscore = (TextComponentScore)p_equals_1_;
return this.name.equals(textcomponentscore.name) && this.objective.equals(textcomponentscore.objective) && super.equals(p_equals_1_);
}
}
public String toString()
{
return "ScoreComponent{name='" + this.name + '\'' + "objective='" + this.objective + '\'' + ", siblings=" + this.siblings + ", style=" + this.getStyle() + '}';
}
}
// NOTE (AI): The score lookup at line 65 sits inside a resolve() method commented out in the cloned source. Included as the only Artemis scoreboard-domain consumer beyond the wrapper interfaces.Related Packets
Wiki Cross-Reference
The score holder name is an arbitrary string rather than a real player name, so fake-player entries and raw UUID strings are legal row keys.
MCP 1.8.9 S3CPacketUpdateScore implements Packet
1.8.9 callers: ServerScoreboard.func_96536_a sends new S3CPacketUpdateScore (line 33): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.
Vanilla Internals
Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.
Module Analyses Using S3CPacketUpdateScore
Full source walkthroughs of the modules and anti-cheats that use this packet.