Interface StreakStateAccessor

All Known Implementing Classes:
PassiveEffectsMixin

public interface StreakStateAccessor
Duck interface injected into LivingEntity via PassiveEffectsMixin for tracking consecutive mining or combat interactions against identical target identifiers (used by StreakEffect).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Retrieves the current accumulated streak count for the specified target registry identifier.
    void
    enchantment_core$incrementStreak(String targetId, int maxStreak, int timeoutTicks)
    Increments the streak counter for targetId (clamped to maxStreak) if it matches the previous target, or resets the counter to 1 for a new target, and refreshes the expiration timer.
  • Method Details

    • enchantment_core$getStreakCount

      int enchantment_core$getStreakCount(String targetId)
      Retrieves the current accumulated streak count for the specified target registry identifier.
      Parameters:
      targetId - The registry key string of the target block or entity type.
      Returns:
      The current consecutive streak count if targetId matches the active streak target, or 0 otherwise.
    • enchantment_core$incrementStreak

      void enchantment_core$incrementStreak(String targetId, int maxStreak, int timeoutTicks)
      Increments the streak counter for targetId (clamped to maxStreak) if it matches the previous target, or resets the counter to 1 for a new target, and refreshes the expiration timer.
      Parameters:
      targetId - The registry key string of the target block or entity type.
      maxStreak - The maximum allowed streak count ceiling.
      timeoutTicks - The number of ticks before the streak expires from inactivity.