Class GatherItemsVillagerTask
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<VillagerEntity>
net.minecraft.entity.ai.brain.task.GatherItemsVillagerTask
public class GatherItemsVillagerTask extends Task<VillagerEntity>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.brain.task.Task
Task.Status -
Field Summary
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates -
Constructor Summary
Constructors Constructor Description GatherItemsVillagerTask() -
Method Summary
Modifier and Type Method Description protected voidfinishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private static Set<Item>getGatherableItems(VillagerEntity villagerEntity, VillagerEntity villagerEntity2)private static voidgiveHalfOfStack(VillagerEntity villager, Set<Item> validItems, LivingEntity target)protected voidkeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected voidrun(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected booleanshouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected booleanshouldRun(ServerWorld serverWorld, VillagerEntity villagerEntity)Methods inherited from class net.minecraft.entity.ai.brain.task.Task
getStatus, isTimeLimitExceeded, stop, tick, toString, tryStarting
-
Field Details
-
items
-
-
Constructor Details
-
GatherItemsVillagerTask
public GatherItemsVillagerTask()
-
-
Method Details
-
shouldRun
- Overrides:
shouldRunin classTask<VillagerEntity>
-
shouldKeepRunning
protected boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunningin classTask<VillagerEntity>
-
run
- Overrides:
runin classTask<VillagerEntity>
-
keepRunning
- Overrides:
keepRunningin classTask<VillagerEntity>
-
finishRunning
- Overrides:
finishRunningin classTask<VillagerEntity>
-
getGatherableItems
private static Set<Item> getGatherableItems(VillagerEntity villagerEntity, VillagerEntity villagerEntity2) -
giveHalfOfStack
private static void giveHalfOfStack(VillagerEntity villager, Set<Item> validItems, LivingEntity target)
-