Skip to content

Commit

Permalink
Create Worldedit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
radmanplays authored Sep 11, 2024
1 parent 53245cd commit 359ecc0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examplemods/Worldedit.js
Original file line number Diff line number Diff line change
@@ -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;
}
});
});
})();

0 comments on commit 359ecc0

Please sign in to comment.