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 TypeMethodDescriptionintenchantment_core$getStreakCount(String targetId) Retrieves the current accumulated streak count for the specified target registry identifier.voidenchantment_core$incrementStreak(String targetId, int maxStreak, int timeoutTicks) Increments the streak counter fortargetId(clamped tomaxStreak) if it matches the previous target, or resets the counter to1for a new target, and refreshes the expiration timer.
-
Method Details
-
enchantment_core$getStreakCount
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
targetIdmatches the active streak target, or0otherwise.
-
enchantment_core$incrementStreak
Increments the streak counter fortargetId(clamped tomaxStreak) if it matches the previous target, or resets the counter to1for 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.
-