changed to return null

instead of throwing exception
This commit is contained in:
Nameless-123 committed 2020-04-26 11:25:22 +02:00
1 parent c3fe3530cc
commit c255e6f330
1 file changed
+2 -2
@@ -894,7 +894,7 @@ public class EntityValue extends Value
put("gamemode", (e,v)->{
if(!(e instanceof ServerPlayerEntity)){
throw new InternalExpressionException("Cannot change the gamemode of non-player entities");
return;
}
switch(v.getString().toLowerCase()){
@@ -910,7 +910,7 @@ public class EntityValue extends Value
case 2:((ServerPlayerEntity) e).setGameMode(GameMode.ADVENTURE);return;
case 3:((ServerPlayerEntity) e).setGameMode(GameMode.SPECTATOR);return;
}
throw new InternalExpressionException(NumericValue.asNumber(v).getLong()+" is an invalid gamemode id");
return;
});
put("jumping",(e,v)->{