From c255e6f33010951af17fe8a789985e896b7d2900 Mon Sep 17 00:00:00 2001 From: Nameless-123 <53367549+Nameless-123@users.noreply.github.com> Date: Sun, 26 Apr 2020 11:25:22 +0200 Subject: [PATCH] changed to return null instead of throwing exception --- src/main/java/carpet/script/value/EntityValue.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 82ef8219..a7f4fc29 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -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)->{