public abstract class TargetGoal
extends net.minecraft.entity.ai.goal.Goal
Modifier and Type | Field and Description |
---|---|
protected boolean |
shouldCheckSight
If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets.
|
protected float |
targetDistance
The distance that the entity can see a target from.
|
protected net.minecraft.entity.CreatureEntity |
taskOwner
The entity that this task belongs to
|
Constructor and Description |
---|
TargetGoal(net.minecraft.entity.CreatureEntity entity,
float par2,
boolean par3,
boolean par4)
Initializes a targeting AI.
|
TargetGoal(PixelmonEntity par1EntityLiving,
float par2,
boolean par3)
Initializes a targeting AI.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canContinueToUse()
Returns whether an in-progress EntityAIBase should continue executing.
|
protected boolean |
isSuitableTarget(net.minecraft.entity.LivingEntity entity,
boolean targetInvulnerable)
A method used to see if an entity is a suitable target through a number of checks.
|
void |
start()
Execute a one-shot task or start executing a continuous task.
|
void |
stop()
Resets the task.
|
void |
tick() |
protected net.minecraft.entity.CreatureEntity taskOwner
protected float targetDistance
protected boolean shouldCheckSight
public TargetGoal(PixelmonEntity par1EntityLiving, float par2, boolean par3)
par1EntityLiving
- The Pokémon to give the targeting AI to.par2
- The distance that the entity can see a target from.par3
- Whether targets must be visible to the entity to be targeted.public TargetGoal(net.minecraft.entity.CreatureEntity entity, float par2, boolean par3, boolean par4)
entity
- The entity to give the targeting AI to.par2
- The distance that the entity can see a target from.par3
- Whether targets must be visible to the entity to be targeted.par4
- Whether to check if the entity can reach its target.public boolean canContinueToUse()
canContinueToUse
in class net.minecraft.entity.ai.goal.Goal
public void start()
start
in class net.minecraft.entity.ai.goal.Goal
public void stop()
stop
in class net.minecraft.entity.ai.goal.Goal
public void tick()
tick
in class net.minecraft.entity.ai.goal.Goal
protected boolean isSuitableTarget(net.minecraft.entity.LivingEntity entity, boolean targetInvulnerable)
entity
- The entity to check for being a suitable target.targetInvulnerable
- Whether to target players that are invincible.