Update mobnpcspawner.js

This commit is contained in:
radmanplays 2024-09-29 16:46:57 +03:30 committed by GitHub
parent 17a1e6ebcf
commit 023a2dd855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,6 @@
(() => {
PluginAPI.dedicatedServer.appendCode(function () {
PluginAPI.addEventListener("processcommand", (event) => {
// Check if the sender is a player
if (!ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP").instanceOf(event.sender.getRef())) { return; }
// Check if the command is "/spawnnpc"
if (event.command.toLowerCase().startsWith("/spawnnpc")) {