From 359ecc05066f98f4789449a51fe86c10d225471f Mon Sep 17 00:00:00 2001 From: radmanplays <95340057+radmanplays@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:21:10 +0330 Subject: [PATCH] Create Worldedit.js --- examplemods/Worldedit.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examplemods/Worldedit.js diff --git a/examplemods/Worldedit.js b/examplemods/Worldedit.js new file mode 100644 index 0000000..b9092c4 --- /dev/null +++ b/examplemods/Worldedit.js @@ -0,0 +1,14 @@ +//WIP worldedit by radmanplays + +(() => { + const prefix = "[worldedit] " + PluginAPI.dedicatedServer.appendCode(function () { + PluginAPI.addEventListener("processcommand", (event) => { + if (event.command.toLowerCase().startsWith("//wand")) { + event.sender.sendChatMessage(ModAPI.util.str("/give @s wooden_axe")) + event.sender.addChatMessage(ModAPI.reflect.getClassById("net.minecraft.util.ChatComponentText").constructors[0](ModAPI.util.str(prefix + "a wand has been added to your inventory"))); + event.preventDefault = true; + } + }); + }); +})();