Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-05-27 00:53:49 -03:00
commit cd1e9d7264
1 file changed
+12
@@ -861,7 +861,10 @@ public class EntityValue extends Value
if (!(e instanceof LivingEntity)) return;
LivingEntity le = (LivingEntity)e;
if (v == null)
{
le.clearStatusEffects();
return;
}
else if (v instanceof ListValue)
{
List<Value> lv = ((ListValue) v).getItems();
@@ -895,6 +898,15 @@ public class EntityValue extends Value
return;
}
}
else
{
String effectName = v.getString();
StatusEffect effect = Registry.STATUS_EFFECT.get(new Identifier(effectName));
if (effect == null)
throw new InternalExpressionException("Wrong effect name: "+effectName);
le.removeStatusEffect(effect);
return;
}
throw new InternalExpressionException("'effect' needs either no arguments (clear) or effect name, duration, and optional amplifier, show particles and show icon");
});