mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
docs: add action scripting concept
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# Action Scripting
|
||||
|
||||
Currently, the npc action system is quite limited with the available action types. There is no way to create conditional actions or to have loops.
|
||||
This is where action scripting comes in. Action scripting allows you to create complex actions using a scripting language.
|
||||
|
||||
The idea is to have a directory (`plugins/FancyNpcs/scripts`) where Kotlin scripts can be placed. These scripts can then be executed by the npc action system.
|
||||
|
||||
There will be a new default action type called `run_script`, which will execute a script. The script file name will be passed as an argument to the action.
|
||||
|
||||
The script will have full access to the current action context, which includes the npc, the player, and the action list. The script can also access to the Paper API.
|
||||
Reference in New Issue
Block a user