--- a/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
+++ b/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
@@ -76,6 +76,19 @@
     public static final DynamicCommandExceptionType ERROR_ENTITY_TYPE_INVALID = new DynamicCommandExceptionType(
         entity -> Component.translatableEscape("argument.entity.options.type.invalid", entity)
     );
+    // Paper start - tell clients to ask server for suggestions for EntityArguments
+    public static final DynamicCommandExceptionType ERROR_ENTITY_TAG_INVALID = new DynamicCommandExceptionType((object) -> {
+        return io.papermc.paper.adventure.PaperAdventure
+            .asVanilla(net.kyori.adventure.text.Component
+                .text("Invalid or unknown entity type tag '" + object + "'")
+                .hoverEvent(net.kyori.adventure.text.event.HoverEvent
+                    .showText(net.kyori.adventure.text.Component
+                        .text("You can disable this error in 'paper.yml'")
+                    )
+                )
+            );
+    });
+    // Paper end - tell clients to ask server for suggestions for EntityArguments
 
     private static void register(String id, EntitySelectorOptions.Modifier handler, Predicate<EntitySelectorParser> condition, Component description) {
         OPTIONS.put(id, new EntitySelectorOptions.Option(handler, condition, description));
@@ -297,6 +310,12 @@
 
                         if (reader.isTag()) {
                             TagKey<EntityType<?>> tagKey = TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.read(reader.getReader()));
+                            // Paper start - tell clients to ask server for suggestions for EntityArguments; throw error if invalid entity tag (only on suggestions to keep cmd success behavior)
+                            if (reader.parsingEntityArgumentSuggestions && io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getTag(tagKey).isEmpty()) {
+                                reader.getReader().setCursor(i);
+                                throw ERROR_ENTITY_TAG_INVALID.createWithContext(reader.getReader(), tagKey);
+                            }
+                            // Paper end - tell clients to ask server for suggestions for EntityArguments
                             reader.addPredicate(entity -> entity.getType().is(tagKey) != bl);
                         } else {
                             ResourceLocation resourceLocation = ResourceLocation.read(reader.getReader());
