code: public static String getUnlocalisedEntityName(Entity e)
      {
          String name;
          if (e.hasCustomName())
          {
              name = e.getCustomNameTag();
          }
          else if (e instanceof EntityPlayer)
          {
              name = e.getName(); // Just returns the user name
          }
          else
          {
              name = EntityList.getEntityString(e);
              if (name == null)
                  name = "unknown";
          }
          return name;
      }
docs: Does essentially the same as entity.getName(), but without pushing the result
  through the translation layer. This ensures the result matches what we use in Types.XSD,
  and prevents things like "entity.ShulkerBullet.name" being returned, where there is no
  translation provided in the .lang file.
  @param ent The entity
  @return The entity's name.