[TUTORIAL] Custom signs

Discussion in 'Resources' started by dan14941, May 10, 2014.

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

    dan14941

    This is a work in progress custom sign tutorial, so here it goes.

    Firstly you are going to want to add the event to your code
    Code:java
    1. @EventHandler
    2. public void onSignCreate(SignChangeEvent e)
    3. {
    4. //code
    5. }


    Now inside the event code you are going to want to check for the sign like this
    Code:java
    1. // get the line \/ \/ and checks that the second line is empty
    2. if (e.getLine(0).equalsIgnoreCase("[TUTORIAL]") && !e.getLine(1).isEmpty())
    3. {\\ Changes line to color
    4. e.setLine(0, "§1[TUTORIAL]");
    5. }

    above at the
    Code:java
    1. e.setLine(0, "§1[TUTORIAL]");

    it is "0" for the line number then a comma and your text.

    So that's it now you can go and check if the sign is clicked but im not going to write that up. Other than that its pretty easy hope I helped!
     
Thread Status:
Not open for further replies.

Share This Page