Get the text of Sign

Discussion in 'Plugin Development' started by Hotshot, Apr 6, 2012.

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

    Hotshot

    So I have a Sign and it's in the Block object... What do I have to do to get the text off of the sign, and effectively cast it to the Sign class?

    Ive tried this:

    Code:
    if(clickedBlock.getType() == Material.SIGN)
    {
            Sign sign = (Sign) clickedBlock.getState();
            String[] lines = sign.getLines();
    }
    Since sign extends block state, this should would. But it doesnt?
     
  2. Offline

    IcyRelic

    ive done it with sending messages
    to get what line 1 2 3 or 4 say send a message with the string being sign.getLine(0); or sign.getLine(1); or sign.getLine(2); sign.getLine(3);
     
  3. Offline

    Hotshot

    That the same exact thing as String[] lines = sign.getLines();
     
  4. Offline

    IcyRelic

    what are you trying to do with the lines
     
  5. Offline

    Hotshot

    I need to get the text off of a block object. You cant use getLine() on a block object.
     
Thread Status:
Not open for further replies.

Share This Page