Send an image in chat

Discussion in 'Plugin Development' started by nfell2009, Dec 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    nfell2009

    Hi there!

    So I saw this: http://imgur.com/a/hoxLD and wondered if it's possible to send an image in chat.

    Anyone got an ideas/methods/ways/whatever of making this work?

    Thanks :)
     
  2. Offline

    timtower Administrator Administrator Moderator

    @nfell2009 Possible indeed, it doesn't look pretty but it is possible
     
  3. Offline

    nfell2009

    @timtower Good to know! At least I'm not wasting my time researching xD It's more of a fun thing than what the examples show :p
     
  4. Offline

    Bobcat00

  5. Offline

    Skionz

  6. Offline

    nfell2009

  7. Offline

    Skionz

    @nfell2009 Send a message with a bunch of them in
    █████
    █████
    █████
    █████
    █████
    █████
    █████
    █████
     
    timtower likes this.
  8. Offline

    nfell2009

    Managed to get this sorted. Changed from getResource to new File

    Code:
        public static void ShowImg(Player player, String path, String line1, String line2, String line3) {
              BufferedImage imageToSend = null;
            try {
                imageToSend = ImageIO.read(new File(path));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
              new ImageMessage(imageToSend, 8, ImageChar.MEDIUM_SHADE.getChar()).appendText("", "", "", line1, line2, line3).sendToPlayer(player);
        }
    
     
  9. Offline

    CraftCreeper6

    @nfell2009
    You should follow Java Naming conventions ("ShowImg").
     
  10. Offline

    Funergy

Thread Status:
Not open for further replies.

Share This Page