DamageIndicatorClamp

public final class DamageIndicatorClamp

Global cap for outbound ClientboundLevelParticlesPacket particles of type DAMAGE_INDICATOR.

Vanilla Player.attack(Entity) spawns one damage-indicator particle per two points of damage dealt. Plugins that boost player melee damage into the five- to seven-figure range therefore broadcast a single particle packet whose count field asks the client to instantiate hundreds of thousands of particles locally, which freezes the client.

When getMaxParticles returns a positive value, the per-version netty handler installed by PacketInteractionListener mutates any outbound damage-indicator particle packet whose count exceeds the cap so it carries the cap value instead. Other particle types and packets with a count within the cap pass through untouched.

Properties

Link copied to clipboard
public static volatile int maxParticles

Functions

Link copied to clipboard
public static int getMaxParticles()
Link copied to clipboard
public static boolean isEnabled()
Link copied to clipboard
public static void setMaxParticles(int max)