public class EntityAIControlledByPlayer extends EntityAIBase
Modifier and Type | Field and Description |
---|---|
private float |
currentSpeed |
private float |
maxSpeed |
private int |
maxSpeedBoostTime
Maximum time the entity's speed should be boosted for.
|
private boolean |
speedBoosted
Whether the entity's speed is boosted.
|
private int |
speedBoostTime
Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled
|
private EntityLiving |
thisEntity |
Constructor and Description |
---|
EntityAIControlledByPlayer(EntityLiving entitylivingIn,
float maxspeed) |
Modifier and Type | Method and Description |
---|---|
void |
boostSpeed()
Boost the entity's movement speed.
|
boolean |
isControlledByPlayer()
Return whether the entity is being controlled by a player.
|
boolean |
isSpeedBoosted()
Return whether the entity's speed is boosted.
|
private boolean |
isStairOrSlab(Block blockIn)
True if the block is a stair block or a slab block
|
void |
resetTask()
Resets the task
|
boolean |
shouldExecute()
Returns whether the EntityAIBase should begin execution.
|
void |
startExecuting()
Execute a one shot task or start executing a continuous task
|
void |
updateTask()
Updates the task
|
continueExecuting, getMutexBits, isInterruptible, setMutexBits
private final EntityLiving thisEntity
private final float maxSpeed
private float currentSpeed
private boolean speedBoosted
private int speedBoostTime
private int maxSpeedBoostTime
public EntityAIControlledByPlayer(EntityLiving entitylivingIn, float maxspeed)
public void startExecuting()
startExecuting
in class EntityAIBase
public void resetTask()
resetTask
in class EntityAIBase
public boolean shouldExecute()
shouldExecute
in class EntityAIBase
public void updateTask()
updateTask
in class EntityAIBase
private boolean isStairOrSlab(Block blockIn)
public boolean isSpeedBoosted()
public void boostSpeed()
public boolean isControlledByPlayer()