mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 20:22:37 +00:00
Create Combat Handler to help Ai to help manage which player should be at tacked
This commit is contained in:
1 parent
97d3df9f38
commit
ebffc0e80e
7 files changed
+253
-69
No files matched your search
@@ -8,15 +8,15 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
public class EntityAISprintToTarget extends EntityAIBase
|
||||
{
|
||||
/** The entity that is leaping. */
|
||||
EntityNPCInterface runner;
|
||||
private EntityNPCInterface runner;
|
||||
|
||||
/** The entity that the leaper is leaping towards. */
|
||||
EntityLivingBase runTarget;
|
||||
private EntityLivingBase runTarget;
|
||||
|
||||
public EntityAISprintToTarget(EntityNPCInterface par1EntityLiving)
|
||||
{
|
||||
this.runner = par1EntityLiving;
|
||||
this.setMutexBits(AiMutex.PASSIVE + AiMutex.PATHING);
|
||||
this.setMutexBits(AiMutex.PASSIVE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,9 +37,9 @@ public class EntityAISprintToTarget extends EntityAIBase
|
||||
else
|
||||
{
|
||||
switch(this.runner.ai.onAttack)
|
||||
{
|
||||
case 0 : return this.runner.getDistanceSqToEntity(this.runTarget) >= 64.0D ? (!this.runner.onGround ? false : true) : false;
|
||||
case 2 : return this.runner.getDistanceSqToEntity(this.runTarget) <= 49.0D ? (!this.runner.onGround ? false : true) : false;
|
||||
{
|
||||
case 0 : return !this.runner.isInRange(runTarget, 8)? (!this.runner.onGround ? false : true) : false;
|
||||
case 2 : return this.runner.isInRange(runTarget, 7)? (!this.runner.onGround ? false : true) : false;
|
||||
default : return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user