Skip to content

Commit

Permalink
Update Worldedit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
radmanplays authored Sep 12, 2024
1 parent f197ae6 commit 5867183
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examplemods/Worldedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
(() => {
PluginAPI.dedicatedServer.appendCode(function () {
PluginAPI.addEventListener("processcommand", (event) => {
if (!ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP").instanceOf(event.sender.getRef())) {return}
if (event.command.toLowerCase().startsWith("//wand")) {
if (ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP").instanceOf(event.sender.getRef())) {
// Create a new ItemStack for the custom item
const ItemStackClass = ModAPI.reflect.getClassById("net.minecraft.item.ItemStack");
const itemStack = ItemStackClass.constructors[4](
Expand Down Expand Up @@ -63,7 +63,6 @@ ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
player.addChatMessage(ChatComponentTextClass.constructors[0](ModAPI.util.str(prefix + "A wand has been added to your inventory.")));

event.preventDefault = true;
}
}
});
});
Expand Down

0 comments on commit 5867183

Please sign in to comment.