Fix blaze telefrag
Blazes won't use their melee for 3 seconds after aggroing to prevent instantly killing players hanging around spawners.
This commit is contained in:
parent
30b44ed43e
commit
483569ce0a
|
|
@ -6,10 +6,12 @@ import net.minecraft.world.entity.monster.Blaze;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(targets = "net.minecraft.world.entity.monster.Blaze$BlazeAttackGoal")
|
@Mixin(targets = "net.minecraft.world.entity.monster.Blaze$BlazeAttackGoal")
|
||||||
public class BlazeAIRework {
|
public class BlazeAIRework{
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
private int attackTime;
|
private int attackTime;
|
||||||
|
|
@ -22,4 +24,8 @@ public class BlazeAIRework {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method="start", at=@At("HEAD"))
|
||||||
|
private void meleeGrace(CallbackInfo ci){
|
||||||
|
this.attackTime=60;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue