public interface Agent extends Living
Living that has AI. In the future Sponge will
allow for custom AIs, but for now vanilla behavior can only be disabled.UNKNOWN| Modifier and Type | Method and Description |
|---|---|
default Value<Boolean> |
aiEnabled()
Gets the
Value for whether AI tasks are enabled or not. |
default AgentData |
getAgentData()
|
<T extends Agent> |
getGoal(GoalType type)
|
Optional<Entity> |
getTarget()
Gets the current target, usually according to the various
AITasks that are acting on this agent. |
void |
setTarget(Entity target)
Sets the current target, usually to bypass what the
AITasks are
deciding to be the target. |
getDamageableData, getHeadRotation, getHealthData, health, lastAttacker, lastDamage, lookAt, maxHealth, setHeadRotationaddPassenger, canSee, clearPassengers, createArchetype, createSnapshot, damage, getBaseVehicle, getBoundingBox, getCreator, getNearbyEntities, getNearbyEntities, getNotifier, getPassengers, getRandom, getRotation, getScale, getTransform, getType, getVehicle, getVelocity, gravity, hasPassenger, isLoaded, isOnGround, isRemoved, remove, removePassenger, setCreator, setLocation, setLocationAndRotation, setLocationAndRotation, setLocationAndRotationSafely, setLocationAndRotationSafely, setLocationSafely, setNotifier, setRotation, setScale, setTransform, setTransformSafely, setVehicle, setVelocity, transferToWorld, transferToWorld, transferToWorld, transferToWorldgetUniqueIdgetLocation, getWorldsetRawData, validateRawDatagetContentVersion, toContainergetApplicableProperties, getPropertycopyFrom, copyFrom, get, getContainers, getOrCreate, offer, offer, offer, offer, offer, offer, remove, remove, remove, require, supports, transform, tryOffer, tryOffer, tryOffer, tryOffer, undocopy, get, getKeys, getOrElse, getOrNull, getValue, getValues, require, supports, supportsgetTranslationlaunchProjectile, launchProjectilegetTeamRepresentationOptional<Entity> getTarget()
AITasks that are acting on this agent.void setTarget(@Nullable Entity target)
AITasks are
deciding to be the target.target - The target entity, or nulldefault AgentData getAgentData()
default Value<Boolean> aiEnabled()
Value for whether AI tasks are enabled or not.<T extends Agent> Optional<Goal<T>> getGoal(GoalType type)
T - Inferred agent typetype - GoalType to lookupOptional.empty() if not found.