Interface EntityBrain
- All Known Subinterfaces:
DragonBrain, VillagerBrain
- All Known Implementing Classes:
BukkitBrain
public interface EntityBrain
Represents an Entire Entity Brain
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanSee(@Nullable EntityBrain brain) Whether this Mob can see another Entity.booleanWhether this Mob can see another Entity.voidClears this Entity's Restriction Area.default booleancontainsAllMemories(@NotNull Memory<?>... memories) Whether this Brain contains all of these memories.booleancontainsMemory(@NotNull Memory<?> memory) Whether this Brain contains this memory.@NotNull EntityNavigationCreates new Entity Navigation associated with this Brain.@NotNull AttributeInstancegetAttributeInstance(@NotNull Attribute a) Fetches a MobChip Attribute Instance.Get the Entity's Behavior associated with this Brain.@NotNull EntityBodygetBody()Fetches the Entity Body Editor.@NotNull EntityCombatTrackerFetches the Entity's Combat Tracker.@NotNull EntityControllerGet the Entity Controller associated with this Brain.@NotNull MobGet the Entity that this Brain relates to.longgetExpiration(@NotNull Memory<?> memory) Get the expiration date of this Memory.@NotNull EntityAIGet the Entity AI associated with this Brain.<T> TFetch the Memory that is stored in this Entity's Brain.getMemoryStatus(@NotNull Memory<?> memory) Fetches the status of a Memory.Gets the current restriction area.intFetch the current restriction radius for this entity.@NotNull EntityScheduleManagerGet the Entity's Scheduling Manager associated with this Brain.@NotNull EntitySensesFetches this Entity's Senses.@NotNull EntityAIGet the Entity Target AI associated with this Brain.booleanWhether this entity has a restriction area.booleanWhether this Entity is in its restriction area.voidremoveMemory(@NotNull Memory<?> memory) Removes a Memory from this EntityBrain.default voidsetMemories(@NotNull Map<Memory, ?> map) Sets multiple permanent memories into this Entity's Brain.default voidsetMemories(@NotNull Map<Memory, ?> map, long expire) Sets multiple temporary memories into this Entity's Brain.<T> voidSets a permanent memory into this entity's brain.<T> voidSets a temporary memory into this entity's brain.voidsetRestrictionArea(Location center, int radius) Sets the Restriction Area for this Entity.
-
Method Details
-
getEntity
Get the Entity that this Brain relates to.- Returns:
- Entity of this brain
-
getGoalAI
Get the Entity AI associated with this Brain.- Returns:
- Entity AI
-
getAttributeInstance
Fetches a MobChip Attribute Instance.- Parameters:
a- Attribute to use- Returns:
- AttributeInstance
-
getTargetAI
Get the Entity Target AI associated with this Brain.- Returns:
- Entity Target AI
-
getController
Get the Entity Controller associated with this Brain.- Returns:
- Entity Controller
-
getScheduleManager
Get the Entity's Scheduling Manager associated with this Brain.- Returns:
- Schedule Manager
-
getBehaviors
EntityBehavior getBehaviors()Get the Entity's Behavior associated with this Brain.- Returns:
- Entity Behavior
-
setMemory
<T> void setMemory(@NotNull @NotNull Memory<T> memory, @Nullable T value) throws IllegalArgumentException Sets a permanent memory into this entity's brain.- Type Parameters:
T- Memory Type- Parameters:
memory- Memory to changevalue- Value of new memory, null to remove- Throws:
IllegalArgumentException- if the value is not suitable for this memory
-
setMemory
<T> void setMemory(@NotNull @NotNull Memory<T> memory, @Nullable T value, long expire) throws IllegalArgumentException Sets a temporary memory into this entity's brain.- Type Parameters:
T- Memory Type- Parameters:
memory- Memory to changevalue- Value of new memoryexpire- How many ticks until this memory will be forgotten/removed- Throws:
IllegalArgumentException- if the value is not suitable for this memory / ticks amount is invalid
-
setMemories
-
setMemories
-
getMemory
Fetch the Memory that is stored in this Entity's Brain.- Type Parameters:
T- Memory Type- Parameters:
memory- Memory to fetch- Returns:
- Found value as an object, null if not present
-
getExpiration
Get the expiration date of this Memory.
For memories with a
Unittype, this value should be read instead of usinggetMemory(Memory).- Parameters:
memory- Memory to fetch- Returns:
- Found expiration date, or 0 if no expiration or not found
-
containsMemory
Whether this Brain contains this memory.- Parameters:
memory- Memory to fetch- Returns:
- true if contains, else false
-
removeMemory
Removes a Memory from this EntityBrain.- Parameters:
memory- Memory to remove
-
getMemoryStatus
Fetches the status of a Memory.- Parameters:
memory- Memory to fetch- Returns:
- Memory Status inside the brain.
-
containsAllMemories
Whether this Brain contains all of these memories.- Parameters:
memories- Group of memories to query- Returns:
- true if they all are contained, else false
-
isInRestriction
boolean isInRestriction()Whether this Entity is in its restriction area.- Returns:
- true if inside, else false
-
setRestrictionArea
Sets the Restriction Area for this Entity.- Parameters:
center- Location centerradius- Radius of restriction center
-
clearRestrictionArea
void clearRestrictionArea()Clears this Entity's Restriction Area. -
getRestrictionArea
-
hasRestriction
boolean hasRestriction()Whether this entity has a restriction area.- Returns:
- true if it has a restriction area, else false
-
getRestrictionRadius
int getRestrictionRadius()Fetch the current restriction radius for this entity.- Returns:
- Restriction Radius
-
canSee
Whether this Mob can see another Entity.- Parameters:
en- Entity to test- Returns:
- true if entity can see, else false
-
canSee
Whether this Mob can see another Entity.- Parameters:
brain- EntityBrain to test- Returns:
- true if entity can see, else false
-
getBody
-
getCombatTracker
Fetches the Entity's Combat Tracker.- Returns:
- Entity Combat Tracker
-
getSenses
-