merge
This commit is contained in:
ZXMushroom63 2024-09-12 16:53:57 +08:00
commit f197ae6fd9

View File

@ -32,6 +32,7 @@ ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
PluginAPI.dedicatedServer.appendCode(function () {
PluginAPI.addEventListener("processcommand", (event) => {
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](
@ -63,6 +64,7 @@ ModAPI.addEventListener("lib:libcustomitems:loaded", () => {
event.preventDefault = true;
}
}
});
});
})();