1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Title

Discussion in 'Development' started by Jonas, Mar 30, 2017.

  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How can i send in the mcpe version 1.0.5 a title on a pmmp server?
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Unless you are using the api3/network branch, these won't work, but there is the $player->addTitle() method. Here is an example:
    PHP:
     /** @var Player $player */
     
    $player->addTitle(string $titlestring $subtitleint $fadeInint $durationint $fadeOut); 
    All of the integers are in ticks, which means 20 = 1 second.
     
    Last edited: Mar 30, 2017
  3. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Must i write string and int
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    No, you don't have to, that was just me identifying the data types for each parameter.
     
  5. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok what is fadeIn and fadeOut?
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    fadIn is the time in ticks that the title fades onto a player's screen, and fadeOut is the time that the title fades out.
     
  7. Jonas

    Jonas Baby Zombie

    Messages:
    192
    It doesnt work my Code is:
    PHP:
    $player->sendTitle("Welcome""on my Server"100100100);
     
  8. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    A dot is not a comma. You should use $player->sendTitle("Welcome", "on my Server", 50, 100, 50);
    Note that the fadeIn and fadeOut is the time it takes to fade in and out, not the time at which it does that.
     
    corytortoise likes this.
  9. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok, Can you give me an example , i dont understand this with the fadeIn and Out
     
  10. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    To my knowledge:
    The fade parameters cause the title to appear more slowly, with it starting very transparent, then slowly(or quickly, depending on the fade) becoming more apparent. Setting both fadeIn and fadeOut to 20, for example, would cause the title to fade in over 1 second, then remain for however long the duration is, then fade out for 1 second.

    It isn't necessary to have a fade at all, so you can set them to 0 or leave them as they are, it won't break your method. However, using 100 for all 3 parameters would cause the title to last almost 15 seconds, which may be longer than desired. I suggest using 20 or 40 for both of the fade parameters to get a smoother title.
     
    Sandertv likes this.
  11. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok thanks, I use that in geh PlayerJoinEvent , but it didn't work
     
  12. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    How doesn't it work? any errors?
     
  13. Jonas

    Jonas Baby Zombie

    Messages:
    192
    No
     
  14. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
  15. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Thats don t work it comes the error: “Call to undefined method pocketmine/Player::addTitle“
     
  16. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Then you are using an incorrect version or are not using PocketMine-MP. Once again, no support for spoons will be provided here.
     
  17. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Can you give me the 1.0.5 Pocketmine MB Version
     
  18. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Poggit creates builds from all branches.
     
  19. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok thanks , the latest version load my Plugins not althaught my Api 3.0.0-ALPHA5 is
     
  20. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    That's a good thing xD
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.