Class AITarget<S extends IState>
java.lang.Object
com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition<S>
com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition<S>
com.minecolonies.api.entity.ai.statemachine.AITarget<S>
- All Implemented Interfaces:
ITickingTransition<S>,IStateMachineTransition<S>
A simple target the AI tries to accomplish. It has a state matcher, so it only gets executed on matching state. It has a tester function to make more checks to tell if execution
is wanted. And it can change state.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAITarget(@NotNull IBooleanConditionSupplier predicate, @NotNull IStateSupplier<S> action, int tickRate) Construct a target.AITarget(S state, @NotNull IBooleanConditionSupplier predicate, @NotNull IStateSupplier<S> action, int tickRate) Construct a target.AITarget(S state, @NotNull IStateSupplier<S> action, int tickRate) Construct a target.Construct a target. -
Method Summary
Methods inherited from class com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition
countdownTicksToUpdate, getTickRate, setTickRate, setTicksToUpdateMethods inherited from class com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition
checkCondition, getMethodName, getName, getNextState, getState, withNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.entity.ai.statemachine.transitions.IStateMachineTransition
checkCondition, getName, getNextState, getState, withName
-
Constructor Details
-
AITarget
public AITarget(@NotNull S state, @NotNull @NotNull IBooleanConditionSupplier predicate, @NotNull @NotNull IStateSupplier<S> action, int tickRate) Construct a target.- Parameters:
state- the state it needs to bepredicate- the predicate for executionaction- the action to applytickRate- the tick rate.
-
AITarget
protected AITarget(@NotNull @NotNull IBooleanConditionSupplier predicate, @NotNull @NotNull IStateSupplier<S> action, int tickRate) Construct a target.- Parameters:
predicate- the predicate for executionaction- the action to applytickRate- the tick rate.
-
AITarget
Construct a target.- Parameters:
predicateState- the state it needs to be | nullstate- the state to switch totickRate- the tick rate.
-
AITarget
Construct a target.- Parameters:
state- the state it needs to be | nullaction- the action to applytickRate- the tick rate.
-