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

Warning message for entity with same UUID shows null for players


    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.13.1
    • Minecraft 1.9, Minecraft 16w33a, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a
    • Confirmed

      The bug

      When you try to summon an entity with the same UUID another entity already has, the entity cannot be summoned.
      Run for example the following command twice and look in the launcher.

      Example command
      /summon armor_stand ~ ~ ~ {UUIDLeast:1L,UUIDMost:1L}
      Game Output
      [Server thread/WARN]: Keeping entity minecraft:armor_stand that already exists with UUID 00000000-0000-0001-0000-000000000001

      However when a player with that UUID already exists it shows null instead of "Player".

      Game Output
      [Server thread/WARN]: Keeping entity null that already exists with UUID 0fec4f7a-6a9b-4c43-ad1b-235e7fbc9822

      How to reproduce

      1. Get your UUID using for example NameMC
      2. Copy the UUID with the hyphens
      3. Use for example JDOODLE to run the following code, after replacing <UUID> with your UUID
        pre 1.11
        java.util.UUID uuid = java.util.UUID.fromString("<UUID>");
        System.out.println(String.format("/summon ArmorStand ~ ~ ~ {UUIDMost:%sL,UUIDLeast:%sL}", uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()));
        java.util.UUID uuid = java.util.UUID.fromString("<UUID>");
        System.out.println(String.format("/summon armor_stand ~ ~ ~ {UUIDMost:%sL,UUIDLeast:%sL}", uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()));
      4. Use the created command in Minecraft

      The reason

      The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

      The reason why this happens is because the class net.minecraft.entity.EntityList does not create a mapping for players. This causes the method net.minecraft.entity.EntityList.getEntityString(Entity) to return null. Having this method return "Player" for players makes the method net.minecraft.entity.Entity.getHoverEvent() show "Player" as type, which is not correct because players do not have an entity type value.

            Unassigned Unassigned
            marcono1234 [Mod] Marcono1234
            3 Vote for this issue
            3 Start watching this issue