diff --git a/patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch index 7f8ea6bcb6..cfcf69a8d4 100644 --- a/patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch @@ -72,6 +72,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 try { argumentparserselector.parse(); +@@ -0,0 +0,0 @@ public class EntityArgument implements ArgumentType { + } + + return argumentparserselector.fillSuggestions(suggestionsbuilder, (suggestionsbuilder1) -> { +- Collection collection = icompletionprovider.getOnlinePlayerNames(); ++ // Paper start ++ final Collection collection; ++ if (icompletionprovider instanceof CommandSourceStack commandSourceStack && commandSourceStack.getEntity() instanceof ServerPlayer sourcePlayer) { ++ collection = new java.util.ArrayList<>(); ++ for (final ServerPlayer player : commandSourceStack.getServer().getPlayerList().getPlayers()) { ++ if (sourcePlayer.getBukkitEntity().canSee(player.getBukkitEntity())) { ++ collection.add(player.getGameProfile().getName()); ++ } ++ } ++ } else { ++ collection = icompletionprovider.getOnlinePlayerNames(); ++ } ++ // Paper end + Iterable iterable = this.playersOnly ? collection : Iterables.concat(collection, icompletionprovider.getSelectedEntities()); + + SharedSuggestionProvider.suggest((Iterable) iterable, suggestionsbuilder1); diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java