Added Scheduled Tasks system for NPC scripting.

Allows for scripting the scheduling of runnable methods in sequence within the NPC's AI

An example sequence of tasks:
1. Dashes towards player (might take 3-5 seconds, doesn't matter, task durations are dynamic so it can take as long as it needs).
2. Punches player away
3. Waits 10 ticks - Fires a ki blast
4. Teleports behind player
5. Knocks player out
This commit is contained in:
bigguy345 committed 2025-03-03 23:59:49 +02:00
1 parent a8e8566e7d
commit 0033413235
4 files changed
+199 -4

No files matched your search

@@ -3,6 +3,7 @@ package noppes.npcs.scripted.entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.api.IActionManager;
import noppes.npcs.api.IPos;
import noppes.npcs.api.ITimers;
import noppes.npcs.api.entity.ICustomNpc;
@@ -1379,4 +1380,9 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
public void updateClient() { this.npc.updateClient(); }
public void updateAI() { this.npc.updateTasks(); }
@Override
public IActionManager getActionManager() {
return npc.actionManager;
}
}