From b859bb5b8adddba3c30c40f84f3c6e0b80232466 Mon Sep 17 00:00:00 2001 From: Zn10plays <72399198+Zn10plays@users.noreply.github.com> Date: Fri, 5 Mar 2021 22:42:49 -0500 Subject: [PATCH] /effect fix Closes #473 --- src/lib/plugins/effects.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/plugins/effects.js b/src/lib/plugins/effects.js index 56a9bdee..0b0c6041 100644 --- a/src/lib/plugins/effects.js +++ b/src/lib/plugins/effects.js @@ -1,3 +1,4 @@ +const { UserError } = require("../..") module.exports.entity = function (entity, serv) { entity.effects = {} @@ -60,6 +61,7 @@ module.exports.server = function (serv) { return str.match(/(.+?) (\d+)(?: (\d+))?(?: (\d+))?(?: (true|false))?|.*? clear/) || false }, action (params, ctx) { + if (!params[1]) return new UserError('Invalid selector string') const targets = ctx.player ? ctx.player.selectorString(params[1]) : serv.selectorString(params[1]) if (params[2] === 'clear') { targets.forEach(e => Object.keys(e.effects).forEach(effectId => {