Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Set Text

Comments in 'Plugin Development' started by Mac_MC, Apr 19, 2014.

  1. Mac_MC
    Offline

    Mac_MC Banned

    Joined:
    Mar 9, 2014
    Posts:
    10
    Minecraft User:
    Mac_DRK
    Hey coders, a new code question:
    How i write text on a sign?
    Here is an example:

    PHP:
        public function eventHandler($data){
            if(
    $data->class == TILE_SIGN){
                if(
    $data->data["Text1"] === "test"){
                   
    //["Text2"]-> "text"
                   
                
    }
            }
        }
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Hi there!
    Well... I dont know, but I think that @Falk can help you.
    P.S: I recommend you to start learning the upcomming API of PocketMine 1.4 in order to supoort it: http://docs.pocketmine.net
    Mac_MC likes this.
  3. Nautox
    Offline

    Nautox Banned

    Joined:
    Mar 29, 2014
    Posts:
    8
    Minecraft User:
    Nautox
    Try this:
    Last edited: Apr 19, 2014
    Mac_MC likes this.
  4. Topic
    Offline

    Topic New Member Plugin Developer

    Joined:
    Aug 29, 2013
    Posts:
    47
    Plugins:
    3
    Minecraft User:
    topic
    I have, more easy code, it's in my SignOnline plugin

    Attached Files:

  5. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    PHP:
    public function eventHandler($data){
    $textLine 3;//so the text will be on line 3
    $text "Hello world!";//classic
    if($data->class == TILE_SIGN){
       if(
    $data->data["Text1"] === "test"){
          
    $data->data["Text".$textLine]=$text;
       }
    }
    }
    Worked in my plugin.

Share This Page

Advertisement