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
AITask s that are acting on this agent. |
void |
setTarget(Entity target)
Sets the current target, usually to bypass what the
AITask s are
deciding to be the target. |
getDamageableData, getHeadRotation, getHealthData, health, lastAttacker, lastDamage, lookAt, maxHealth, setHeadRotation
addPassenger, addTag, canSee, clearPassengers, createArchetype, createSnapshot, damage, getBaseVehicle, getBoundingBox, getCreator, getNearbyEntities, getNearbyEntities, getNotifier, getPassengers, getRandom, getRotation, getScale, getTags, getTransform, getType, getVehicle, getVelocity, gravity, hasPassenger, hasTag, isLoaded, isOnGround, isRemoved, remove, removePassenger, removeTag, setCreator, setLocation, setLocationAndRotation, setLocationAndRotation, setLocationAndRotationSafely, setLocationAndRotationSafely, setLocationSafely, setNotifier, setRotation, setScale, setTransform, setTransformSafely, setVehicle, setVelocity, transferToWorld, transferToWorld, transferToWorld, transferToWorld
getUniqueId
getLocation, getWorld
setRawData, validateRawData
getContentVersion, toContainer
getApplicableProperties, getProperty
copyFrom, copyFrom, get, getContainers, getOrCreate, offer, offer, offer, offer, offer, offer, remove, remove, remove, require, supports, transform, tryOffer, tryOffer, tryOffer, tryOffer, undo
copy, get, getKeys, getOrElse, getOrNull, getValue, getValues, require, supports, supports
getTranslation
launchProjectile, launchProjectile
getTeamRepresentation
Optional<Entity> getTarget()
AITask
s that are acting on this agent.void setTarget(@Nullable Entity target)
AITask
s 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.