Class CustomSensor<T extends LivingEntity>

java.lang.Object
me.gamercoder215.mobchip.ai.sensing.CustomSensor<T>
Type Parameters:
T - Entity Type related with this Sensor.
All Implemented Interfaces:
Sensor<T>, Keyed

public abstract class CustomSensor<T extends LivingEntity> extends Object implements Sensor<T>
Represents a Custom Sensor.
  • Constructor Details

    • CustomSensor

      public CustomSensor(@NotNull @NotNull Class<T> entityClass, @NotNull @NotNull NamespacedKey key)
      Creates a new Custom Sensor with the default Scan Rate.
      Parameters:
      entityClass - Entity Class used
      key - NamespacedKey of this Sensor
    • CustomSensor

      public CustomSensor(@NotNull @NotNull Class<T> entityClass, @NotNull @NotNull NamespacedKey key, int scanRate) throws IllegalArgumentException
      Constructs a Custom Sensor.
      Parameters:
      entityClass - Entity Class used
      key - NamespacedKey of this Sensor
      scanRate - Scan Rate, in Ticks
      Throws:
      IllegalArgumentException - if scan rate is less than 1
  • Method Details

    • getScanRate

      public final int getScanRate()
      Description copied from interface: Sensor
      Fetches the scan rate of how often to check for the memories in Sensor.required(), in ticks.
      Specified by:
      getScanRate in interface Sensor<T extends LivingEntity>
      Returns:
      Memory Scan Rate, in Ticks
    • getEntityClass

      @NotNull public final @NotNull Class<T> getEntityClass()
      Description copied from interface: Sensor
      Fetches the Class Type related to this Sensor.
      Specified by:
      getEntityClass in interface Sensor<T extends LivingEntity>
      Returns:
      Class Type
    • getKey

      public final NamespacedKey getKey()
      Specified by:
      getKey in interface Keyed