Development Assistance Title and subtitle with ProtocolLib

Discussion in 'Plugin Help/Development/Requests' started by LegacyGaming, Dec 16, 2014.

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

    LegacyGaming

    I have some code within my plugin that sets the title. The code works for the title, but not the subtitle.
    The title is set, but then is replaced again by the subtitle. Any Ideas?

    Code:
                PacketContainer PTitle = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.TITLE);
                PTitle.getIntegers().write(0, 0);
                PTitle.getChatComponents().write(0, WrappedChatComponent.fromJson(Title));
              
                PacketContainer PSubTitle = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.TITLE);
                PTitle.getIntegers().write(0, 1);
                PSubTitle.getChatComponents().write(0, WrappedChatComponent.fromJson(SubTitle));
    I have searched everywhere for a fix and can't find anything to do with ProtocolLib. I know you can send the "/title" command but that isn't a method I would like to use.

    EDIT by TImtower: merged posts
     
    Last edited by a moderator: Dec 16, 2014
  2. Offline

    Funergy

    @LegacyGaming Why do you use protocol lib for that? @Skionz knows someone that made a tutorial about this
     
  3. Offline

    LegacyGaming

    Why wouldn't I use ProtocolLib. I'm using it for other plugins on my so I may as well.
     
  4. Offline

    JordyPwner

  5. Offline

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
     
  6. Offline

    LegacyGaming

    Nope, this is for the text in the middle of the screen.

    However, I looked at that thread and that isn't for the tab list. That is what I'm looking for, Thanks :D

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Dec 16, 2014
  7. Offline

    Skionz

  8. Offline

    LegacyGaming

    Its ok. I have already fixed the problem. But thanks anyway.
     
Thread Status:
Not open for further replies.

Share This Page