Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-113962

Error message "Entity ... cannot be found" is shown when multiple entities match selector but only a single entity is expected

    XMLWordPrintable

    Details

    • Confirmation Status:
      Confirmed

      Description

      The bug

      Commands which requires only a single entity print the error message

      Entity '%s' cannot be found
      

      when a selector matches multiple entities.
      The expected error message would be something like

      Selector '%s' matches more than one entity
      

      How to reproduce

      Use the following command when multiple entities are in the world

      /tp @p @e
      

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The method net.minecraft.command.EntitySelector.matchOneEntity(ICommandSender, String, Class<? extends T>) returns null if multiple matching entities were found. It might be better if it threw a CommandException instead.

      Note: The method matchOnePlayer might want to rethrow a more specific exception.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              marcono1234 [Mod] Marcono1234
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: