Enum Class MemoryStatus

java.lang.Object
java.lang.Enum<MemoryStatus>
me.gamercoder215.mobchip.ai.memories.MemoryStatus
All Implemented Interfaces:
Serializable, Comparable<MemoryStatus>, Constable

public enum MemoryStatus extends Enum<MemoryStatus>
Represents the status of a Memory's presence in a brain.

A memory can have three states in a brain:

  • Value Present
  • Value Absent
  • Registered

A Memory being present means that a value is stored in the brain with its type. For example, EntityMemory.NOT_ADMIRING would have either a true or false value present.

A Memory being absent means that a value is not stored in the brain. For example, EntityMemory.NOT_ADMIRING would have no value present.

A Memory being registered means that the memory is present in the Minecraft Registry, and is supported by the mob type. All native memories, such as the ones listed in this class, are all registered in the Minecraft Registry by default, but can be unregistered at any time. However, custom memories are not registered in the Minecraft Registry, and thus, would not be able to be present in the brain.

Additionally, not all mobs support the same memory, making them unregistered when applicable. Passive Mobs do not have EntityMemory.ANGRY_AT registered in their Brain, and Wardens are the only ones with EntityMemory.DISTURBANCE_LOCATION registered.

  • Enum Constant Details

    • PRESENT

      public static final MemoryStatus PRESENT
      Represents a Memory that is in the brain with an assigned value.
    • ABSENT

      public static final MemoryStatus ABSENT
      Represents a Memory that is not present in the brain.
    • REGISTERED

      public static final MemoryStatus REGISTERED

      Represents a Memory that is registered within the Minecraft Registry. In usual cases with Vanilla Memories, they are all registered.

      If the Mob Type does not support the memory type (e.g. Passive Mobs don't have EntityMemory.ANGRY_AT registered), it will still return this enum.

  • Method Details

    • values

      public static MemoryStatus[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MemoryStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null