fixed so modify(..,'effect',...) does what docs say.
This commit is contained in:
1 parent
2c777ea3ad
commit
a1200d4c37
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");
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user