diff --git a/mods/rp_mobs/API.md b/mods/rp_mobs/API.md index 8c4bdbcf..9f0a3503 100644 --- a/mods/rp_mobs/API.md +++ b/mods/rp_mobs/API.md @@ -716,6 +716,9 @@ Add the microtask `microtask` to the specified `task`. Will also initialize the Ends the currently active task in the given `task_queue` of `mob`. If the task queue is empty, nothing happens. +#### `rp_mobs.clear_task_queue(mob, task_queue)` + +Remove all tasks in the given `task_queue`. diff --git a/mods/rp_mobs/api.lua b/mods/rp_mobs/api.lua index feacc38c..74753f7d 100644 --- a/mods/rp_mobs/api.lua +++ b/mods/rp_mobs/api.lua @@ -460,6 +460,10 @@ rp_mobs.end_current_task_in_task_queue = function(mob, task_queue) end end +rp_mobs.clear_task_queue = function(task_queue) + task_queue.tasks:removeAll() +end + rp_mobs.create_task = function(def) local task if def then