Package me.gamercoder215.mobchip
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 boolean
canSee
(@Nullable EntityBrain brain) Whether this Mob can see another Entity.boolean
Whether this Mob can see another Entity.void
Clears this Entity's Restriction Area.default boolean
containsAllMemories
(@NotNull Memory<?>... memories) Whether this Brain contains all of these memories.boolean
containsMemory
(@NotNull Memory<?> memory) Whether this Brain contains this memory.Creates new Entity Navigation associated with this Brain.Fetches a MobChip Attribute Instance.Get the Entity's Behavior associated with this Brain.getBody()
Fetches the Entity Body Editor.Fetches the Entity's Combat Tracker.Get the Entity Controller associated with this Brain.Get the Entity that this Brain relates to.long
getExpiration
(@NotNull Memory<?> memory) Get the expiration date of this Memory.Get the Entity AI associated with this Brain.<T> T
Fetch 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.int
Fetch the current restriction radius for this entity.Get the Entity's Scheduling Manager associated with this Brain.Fetches this Entity's Senses.Get the Entity Target AI associated with this Brain.boolean
Whether this entity has a restriction area.boolean
Whether this Entity is in its restriction area.void
removeMemory
(@NotNull Memory<?> memory) Removes a Memory from this EntityBrain.default void
setMemories
(@NotNull Map<Memory, ?> map) Sets multiple permanent memories into this Entity's Brain.default void
setMemories
(@NotNull Map<Memory, ?> map, long expire) Sets multiple temporary memories into this Entity's Brain.<T> void
Sets a permanent memory into this entity's brain.<T> void
Sets a temporary memory into this entity's brain.void
setRestrictionArea
(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
Sets multiple permanent memories into this Entity's Brain.- Parameters:
map
- Map of Memories to their values
-
setMemories
Sets multiple temporary memories into this Entity's Brain.- Parameters:
map
- Map of Memories to their valuesexpire
- How many ticks until this memory is forgotten/removed
-
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
Unit
type, 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
Location getRestrictionArea()Gets the current restriction area.- Returns:
- Restriction Area
-
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
Fetches the Entity Body Editor.- Returns:
- Entity Body Editor
-
getCombatTracker
Fetches the Entity's Combat Tracker.- Returns:
- Entity Combat Tracker
-
getSenses
Fetches this Entity's Senses.- Returns:
- Entity Senses
-