diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/metadata/MetadataRewriter1_14To1_13_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/metadata/MetadataRewriter1_14To1_13_2.java index 05acc1187..0821341e2 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/metadata/MetadataRewriter1_14To1_13_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/metadata/MetadataRewriter1_14To1_13_2.java @@ -150,13 +150,17 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter { - EntityTracker1_14 tracker = tracker(event.user()); - int entityId = event.entityId(); - tracker.setInsentientData(entityId, (byte) ((tracker.getInsentientData(entityId) & ~0x4) + filter().type(EntityTypes1_14.ABSTRACT_ILLAGER_BASE).handler((event, meta) -> { + if (event.index() == 14) { + EntityTracker1_14 tracker = tracker(event.user()); + int entityId = event.entityId(); + tracker.setInsentientData(entityId, (byte) ((tracker.getInsentientData(entityId) & ~0x4) | (((Number) meta.getValue()).byteValue() != 0 ? 0x4 : 0))); // New attacking - event.createExtraMeta(new Metadata(13, Types1_14.META_TYPES.byteType, tracker.getInsentientData(entityId))); - event.cancel(); // "Has target (aggressive state)" + event.createExtraMeta(new Metadata(13, Types1_14.META_TYPES.byteType, tracker.getInsentientData(entityId))); + event.cancel(); // "Has target (aggressive state)" + } else if (event.index() > 14) { + meta.setId(meta.id() - 1); + } }); filter().handler((event, meta) -> { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java index 88047e36c..5f7e7c417 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/EntityPacketRewriter1_20_5.java @@ -376,7 +376,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter { final int effectColor = meta.value(); @@ -405,7 +405,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter