Interface Sensor<T extends LivingEntity>

Type Parameters:
T - Entity Type related with this Sensor.
All Superinterfaces:
Keyed
All Known Implementing Classes:
CustomSensor

public interface Sensor<T extends LivingEntity> extends Keyed

Represents an action performed when certain Memory objects are present.

This is typically used for updating memories when other memories are present.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Represents the Default Scan Rate of 20 Ticks.
  • Method Summary

    Modifier and Type
    Method
    Description
    Fetches the Class Type related to this Sensor.
    int
    Fetches the scan rate of how often to check for the memories in required(), in ticks.
    Fetches all the Memories required for this Sensor to be performed.
    void
    Performs the Sensor's action.

    Methods inherited from interface org.bukkit.Keyed

    getKey
  • Field Details

    • DEFAULT_SCAN_RATE

      static final int DEFAULT_SCAN_RATE
      Represents the Default Scan Rate of 20 Ticks.
      See Also:
  • Method Details

    • required

      @NotNull @NotNull List<Memory<?>> required()
      Fetches all the Memories required for this Sensor to be performed.
      Returns:
      List of Required Memories
    • getScanRate

      int getScanRate()
      Fetches the scan rate of how often to check for the memories in required(), in ticks.
      Returns:
      Memory Scan Rate, in Ticks
    • getEntityClass

      @NotNull @NotNull Class<T> getEntityClass()
      Fetches the Class Type related to this Sensor.
      Returns:
      Class Type
    • run

      void run(@NotNull @NotNull World w, LivingEntity entity)
      Performs the Sensor's action.
      Parameters:
      w - World
      entity - Entity