diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 7da42c2..7b01079 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -103,6 +103,18 @@ public interface IActionManager { */ void scheduleConditionalAction(String name, int checkIntervalTicks, Supplier predicate, Consumer task, int maxChecks); + /** + * Schedule a conditional action that gives up after at most maxChecks attempts. + * + * @param name unique name + * @param checkIntervalTicks ticks between predicate tests + * @param predicate supplier returning true when it should fire + * @param terminateWhen supplier returning true when it should terminate (gets marked done) + * @param task logic to run once when predicate first becomes true + * @param maxChecks maximum times to test predicate before auto‐cancelling + */ + void scheduleConditionalAction(String name, int checkIntervalTicks, Supplier predicate, Supplier terminateWhen, Consumer task, int maxChecks); + /** * Cancel (remove) the first queued action with the given name. *