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

Gray text help again

Comments in 'Plugin Development' started by Legomite, May 30, 2014.

  1. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    How do you broadcast the gray text without showing the / at the start?
  2. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    220
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
    You can send the raw packet. If you do it with the api, the message will be cleaned
  3. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    According to a different thread you can use this instead of "/":
    PHP:
    $packet = new MessagePacket;
    $packet->source "";
    $packet->message "\nThis is a message";
    $player->dataPacket($packet);
    PEMapModder and Tuff like this.
  4. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Can you explain what each line does?
  5. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    The first line is defining the $packet variable as a MessagePacket, the second i dont really know but i know it is important, the third is the message that will be displayed in gray (\n will not appear but i think it is needed for this to work properly), and the last line sends the data to the player
  6. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Last line sends it to who player?
  7. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Is there a way to broadcast it?
  8. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    try using
    PHP:
    $this->api->chat->broadcast->dataPacket($packet);
    for the last line. I dont know for sure that that will work though.
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I found out this method when I was debugging ChatLineBreaker, but it will be overlapped by the next line.
    Comedyman937 likes this.

Share This Page

Advertisement