diff --git a/ChestCommands/src/com/gmail/filoghost/chestcommands/serializer/CommandSerializer.java b/ChestCommands/src/com/gmail/filoghost/chestcommands/serializer/CommandSerializer.java index e3f9233..4b4e78e 100644 --- a/ChestCommands/src/com/gmail/filoghost/chestcommands/serializer/CommandSerializer.java +++ b/ChestCommands/src/com/gmail/filoghost/chestcommands/serializer/CommandSerializer.java @@ -85,11 +85,11 @@ public class CommandSerializer { for (Entry> entry : commandTypesMap.entrySet()) { Matcher matcher = entry.getKey().matcher(input); if (matcher.find()) { - // Remove the command prefix. - String cleanedCommand = matcher.replaceFirst(""); + // Remove the command prefix and trim the spaces. + String cleanCommand = matcher.replaceFirst("").trim(); try { - return entry.getValue().getDeclaredConstructor(String.class).newInstance(cleanedCommand); + return entry.getValue().getDeclaredConstructor(String.class).newInstance(cleanCommand); } catch (Exception e) { // Checked at startup. }