diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java index ac9c8b7e..9775c982 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java @@ -243,14 +243,26 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { wrapper.passthrough(Types.VAR_INT); // Entity ID - wrapper.passthrough(Types.VAR_INT); // Effect ID + final int effectId = wrapper.passthrough(Types.VAR_INT); final int amplifier = wrapper.read(Types.VAR_INT); wrapper.write(Types.BYTE, (byte) MathUtil.clamp(amplifier, Byte.MIN_VALUE, Byte.MAX_VALUE)); wrapper.passthrough(Types.VAR_INT); // Duration wrapper.passthrough(Types.BYTE); // Flags - wrapper.write(Types.OPTIONAL_COMPOUND_TAG, null); // Add empty factor data + + if (effectId == 32) { // Darkness, keep a stable effect + final CompoundTag factorData = new CompoundTag(); + factorData.putInt("padding_duration", 22); + factorData.putBoolean("had_effect_last_tick", true); + factorData.putFloat("factor_previous_frame", 0); + factorData.putFloat("factor_start", 1); + factorData.putFloat("factor_target", 1); + factorData.putFloat("factor_current", 1); + wrapper.write(Types.OPTIONAL_COMPOUND_TAG, factorData); + } else { + wrapper.write(Types.OPTIONAL_COMPOUND_TAG, null); + } }); protocol.registerClientbound(ClientboundPackets1_20_5.UPDATE_ATTRIBUTES, wrapper -> {