Development Assistance 1.8 Features

Discussion in 'Plugin Help/Development/Requests' started by feff890, Jan 4, 2015.

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

    feff890

    Hey so I heard and saw that there were a few new 1.8 features but there are a few I was wandering how to do. Here they are:
    [​IMG]
    And second:
    [​IMG]
    Any help?
    Thx
     
  2. Offline

    nverdier

    @feff890 The pictures aren't shown. Is it just me?
     
  3. Offline

    Windy Day

    @nverdier
    No its not just you. But I was able to copy the link and open in a new tab to see them.

    @feff890
    Both are 1.8 packets, you can use protocol lib or view this resource on spigot to learn how to use these packets.
     
  4. Offline

    Skionz

  5. Offline

    Windy Day

    The other packet name is PacketPlayOutPlayerListHeaderFooter
     
  6. Offline

    FBXNDR

    You can also use an API for these new 1.8.x functions.. Maybe the BountifulAPI works for that (just google it)..
    But here's my code for a title:
    Code:
    public void sendTitle(Player p, String title, String subtitle){
            IChatBaseComponent titleccomp = ChatSerializer.a(title); //String for the title
            IChatBaseComponent subtitlecomp = ChatSerializer.a(subtitle); //String for the subtitle
           
            PacketTitle time = new PacketTitle(Action.TIMES, 10*1, 20*2, 20*2); //fade-in, stay and fade-out
            PacketTitle t = new PacketTitle(Action.TITLE, titleccomp); //defines the action
            PacketTitle subt = new PacketTitle(Action.SUBTITLE, subtitlecomp);
           
            CraftPlayer craftplayer = (CraftPlayer) p;
           
            int version = craftplayer.getHandle().playerConnection.networkManager.getVersion(); //gets the version to avoid game crashes
           
            if(version >= 47){
                craftplayer.getHandle().playerConnection.sendPacket(subt); //sends the packets to the player
                craftplayer.getHandle().playerConnection.sendPacket(t);
                craftplayer.getHandle().playerConnection.sendPacket(time);
            } else {
                return;
            }
        }
    If you use this, just paste it in your project and put it for example in a command like this:
    Code:
    if(args[0].equalsIgnoreCase("fulltitle")){
                    sendTitle(p, "{ text: \"§3§ltitle string\" }", "{ text: \"§eSubtitle string\" }");
                    //The text has to be in JSON-format
                }
     
    xMakerx likes this.
  7. Online

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
     
Thread Status:
Not open for further replies.

Share This Page