Class JumpInBedTask
public class JumpInBedTask extends Task<MobEntity>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.brain.task.Task
Task.Status
-
Field Summary
Fields Modifier and Type Field Description private BlockPos
bedPos
private int
jumpsRemaining
private int
ticksOutOfBedUntilStopped
private int
ticksToNextJump
private float
walkSpeed
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates
-
Constructor Summary
Constructors Constructor Description JumpInBedTask(float walkSpeed)
-
Method Summary
Modifier and Type Method Description protected void
finishRunning(ServerWorld serverWorld, MobEntity mobEntity, long long2)
private Optional<BlockPos>
getNearestBed(MobEntity mob)
private boolean
isAboveBed(ServerWorld world, MobEntity mob)
private boolean
isBedAt(ServerWorld world, BlockPos pos)
private boolean
isBedGoneTooLong(ServerWorld world, MobEntity mob)
private boolean
isDoneJumping(ServerWorld world, MobEntity mob)
private boolean
isOnBed(ServerWorld world, MobEntity mob)
protected boolean
isTimeLimitExceeded(long time)
protected void
keepRunning(ServerWorld serverWorld, MobEntity mobEntity, long long2)
protected void
run(ServerWorld serverWorld, MobEntity mobEntity, long long2)
private void
setWalkTarget(MobEntity mob, BlockPos pos)
protected boolean
shouldKeepRunning(ServerWorld serverWorld, MobEntity mobEntity, long long2)
protected boolean
shouldRun(ServerWorld serverWorld, MobEntity mobEntity)
private boolean
shouldStartJumping(ServerWorld world, MobEntity mob)
-
Field Details
-
walkSpeed
private final float walkSpeed -
bedPos
-
ticksOutOfBedUntilStopped
private int ticksOutOfBedUntilStopped -
jumpsRemaining
private int jumpsRemaining -
ticksToNextJump
private int ticksToNextJump
-
-
Constructor Details
-
JumpInBedTask
public JumpInBedTask(float walkSpeed)
-
-
Method Details
-
shouldRun
-
run
-
finishRunning
- Overrides:
finishRunning
in classTask<MobEntity>
-
shouldKeepRunning
- Overrides:
shouldKeepRunning
in classTask<MobEntity>
-
isTimeLimitExceeded
protected boolean isTimeLimitExceeded(long time)- Overrides:
isTimeLimitExceeded
in classTask<MobEntity>
-
keepRunning
- Overrides:
keepRunning
in classTask<MobEntity>
-
setWalkTarget
-
shouldStartJumping
-
isAboveBed
-
isOnBed
-
isBedAt
-
getNearestBed
-
isBedGoneTooLong
-
isDoneJumping
-