From 744e9f7393059c2444942394fae74f1e8b4b747b Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 29 Mar 2025 11:19:29 +0100 Subject: [PATCH] docs: add action scripting concept --- .../concepts/fancynpcs/action-scripting.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/src/product-direction/concepts/fancynpcs/action-scripting.md diff --git a/docs/src/product-direction/concepts/fancynpcs/action-scripting.md b/docs/src/product-direction/concepts/fancynpcs/action-scripting.md new file mode 100644 index 00000000..e6dcca5b --- /dev/null +++ b/docs/src/product-direction/concepts/fancynpcs/action-scripting.md @@ -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. \ No newline at end of file