Create Worldedit.js

This commit is contained in:
radmanplays 2024-09-11 22:21:10 +03:30 committed by GitHub
parent 53245cd65a
commit 359ecc0506
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

14
examplemods/Worldedit.js Normal file
View File

@ -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;
}
});
});
})();