Package de.oliver.fancynpcs.api.actions
Klasse NpcAction
java.lang.Object
de.oliver.fancynpcs.api.actions.NpcAction
- Bekannte direkte Unterklassen:
BlockUntilDoneAction,ConsoleCommandAction,ExecuteRandomActionAction,MessageAction,PlayerCommandAction,PlayerCommandAsOpAction,SendToServerAction,WaitAction
The NpcAction class is an abstract class that represents an action that can be performed by an NPC.
Each NpcAction has a name and a flag indicating whether it requires a value.
The NpcAction class provides an abstract execute method that must be implemented by subclasses to specify the behavior of the action when executed.
Subclasses of NpcAction can provide additional data using the NpcActionData record, which includes an order value to specify the order of execution, the NpcAction itself, and a value associated with the action.
This class provides getters for the name and the requiresValue flag of the action.
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungabstract voidexecute(@NotNull ActionExecutionContext context, @Nullable String value) Executes the action associated with this NpcAction.getName()boolean
-
Konstruktordetails
-
NpcAction
-
-
Methodendetails
-
execute
public abstract void execute(@NotNull @NotNull ActionExecutionContext context, @Nullable @Nullable String value) Executes the action associated with this NpcAction.- Parameter:
context- The context in which the action is being executed.value- The value associated with the action. Can be null if no value is required.
-
getName
-
requiresValue
public boolean requiresValue()
-