Sign placement question.

Discussion in 'Plugin Development' started by darknesschaos, Jan 30, 2011.

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

    darknesschaos

    How would I get the text of a sign that has just been placed? When I use the getData part while useing the Player_Item event I get some jibberish data even before I set the text.
    --- merged: Jan 31, 2011 6:45 AM ---
    seems that I probably cant unless they make a hook, oh well, looks like I'm going to hack at it.
     
  2. Offline

    Snowl

    RAWR!
    Code:
        BlockState block = event.getBlock().getState();
        if ((block instanceof Sign)) {
          Sign sign = (Sign)block;
          String line = sign.getLine(1);
     
  3. Offline

    darknesschaos

    I did need that bit, but I dont believe that grabs the text from a freshly placed sign. I could be wrong though.
    --- merged: Jan 31, 2011 7:07 AM ---
    oh, and thanks much for the help!
     
  4. Offline

    Snowl

    When is the sign going to be called? After the player places a sign? When they right click it? When notch logs in then starts stealing stuff from chests :D?
     
  5. Offline

    darknesschaos

    haha, I thought I mentioned it would be right when the player places the sign and after they set its text.
     
  6. Offline

    Snowl

    oh :p sorry :p
    I dunno, you could try
    Code:
        BlockState block = event.getBlock().getState();
        if ((block instanceof Sign)) {
          Sign sign = (Sign)block;
          String line = sign.getLine(1);
           while(sign.getLine(1) != "" || sign.getLine(2) != "" || sign.getLine(3) != "" || sign.getLine(4) != "")
            {
              sign.getLine(1).setLine("What");
            }
        }
    
    note I havent tested this. not even sure thats how you set a line with signs :(
     
  7. Offline

    darknesschaos

    it just seems that I was asking for something overly complicated. ah well. I shall do something about it one way or another. Thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page