diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java index 66b410817..e3dc0feb2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java @@ -33,17 +33,20 @@ public class RandomPatternParser extends InputParser { } // get suggestions for the last token only String token = patterns.get(patterns.size() - 1); + String randString = ""; String previous = String.join(",", patterns.subList(0, patterns.size() - 1)); if (token.matches("[0-9]+(\\.[0-9]*)?%.*")) { String[] p = token.split("%"); if (p.length < 2) { return Stream.empty(); } else { + randString = p[0]; token = p[1]; } } final List innerSuggestions = worldEdit.getPatternFactory().getSuggestions(token); - return innerSuggestions.stream().map(s -> previous + "," + s); + String prev = previous + "," + randString + "%"; + return innerSuggestions.stream().map(s -> prev + s); //FAWE end }