TargetEventBackport for Minecraft 1.16.5 (Forge)
Overview
TargetEventBackport solves a limitation in Minecraft 1.16.5 Forge where the LivingSetAttackTargetEvent is not cancelable. This prevents modders from controlling mob targeting behavior—a feature freely available in modern versions (1.18.2+). This mod bridges the gap by introducing a fully cancelable event, restoring functionality parity with newer Minecraft editions.
Key Features
- �️ Adds
MobChangeTargetEvent:
A cancelable event fired whenever a mob changes its attack target (viaMob#setTarget). - ⚙️ Seamless Integration:
Uses Mixin injections to post the event without altering vanilla behavior when unused. - ✨ High-Version Parity:
Mimics the behavior of Forge'sLivingSetAttackTargetEventin 1.18.2+, enabling:- Canceling unwanted targeting (e.g., stop creepers targeting players).
- Dynamically overriding targets (e.g., redirect mobs to custom entities).
Well, we are including MixinExtras for compatibility reason so the jar file is rather big