Class CustomSensor<T extends LivingEntity>
java.lang.Object
me.gamercoder215.mobchip.ai.sensing.CustomSensor<T>
- Type Parameters:
T- Entity Type related with this Sensor.
Represents a Custom Sensor.
-
Field Summary
Fields inherited from interface Sensor
DEFAULT_SCAN_RATE -
Constructor Summary
ConstructorsConstructorDescriptionCustomSensor(@NotNull Class<T> entityClass, @NotNull NamespacedKey key) Creates a new Custom Sensor with the default Scan Rate.CustomSensor(@NotNull Class<T> entityClass, @NotNull NamespacedKey key, int scanRate) Constructs a Custom Sensor. -
Method Summary
Modifier and TypeMethodDescriptionFetches the Class Type related to this Sensor.final NamespacedKeygetKey()final intFetches the scan rate of how often to check for the memories inSensor.required(), in ticks.
-
Constructor Details
-
CustomSensor
Creates a new Custom Sensor with the default Scan Rate.- Parameters:
entityClass- Entity Class usedkey- 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 usedkey- NamespacedKey of this SensorscanRate- Scan Rate, in Ticks- Throws:
IllegalArgumentException- if scan rate is less than 1
-
-
Method Details
-
getScanRate
public final int getScanRate()Description copied from interface:SensorFetches the scan rate of how often to check for the memories inSensor.required(), in ticks.- Specified by:
getScanRatein interfaceSensor<T extends LivingEntity>- Returns:
- Memory Scan Rate, in Ticks
-
getEntityClass
Description copied from interface:SensorFetches the Class Type related to this Sensor.- Specified by:
getEntityClassin interfaceSensor<T extends LivingEntity>- Returns:
- Class Type
-
getKey
-