diff --git a/src/main/java/carpet/script/CarpetScriptServer.java b/src/main/java/carpet/script/CarpetScriptServer.java index 3c92548f..bd083a98 100644 --- a/src/main/java/carpet/script/CarpetScriptServer.java +++ b/src/main/java/carpet/script/CarpetScriptServer.java @@ -372,10 +372,10 @@ public class CarpetScriptServer public boolean runas(BlockPos origin, ServerCommandSource source, String hostname, String udf_name, List argv) { ScriptHost host = globalHost; - if (hostname != null) - host = modules.get(hostname).retrieveForExecution(source); try { + if (hostname != null) + host = modules.get(hostname).retrieveForExecution(source); host.callUDF(origin, source, host.globalFunctions.get(udf_name), argv); } catch (NullPointerException | InvalidCallbackException npe)