Development Assistance Can not send title.

Discussion in 'Plugin Help/Development/Requests' started by Kargond, Jun 10, 2015.

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


    Hi! I can't send title(or subtitle) to player. Here is line, where I send title.
    TitleLib(p, TITLE, "owh god this is awesome!", 10, 60, 10, ChatColor.GREEN);
    And here is my TitleLib function:
        public TitleLib(Player player, EnumTitleAction titleType, String text, int fadeInTime, int showTime, int fadeOutTime, ChatColor color)
            IChatBaseComponent chatTitle = ChatSerializer.a("{\"text\": \"" + text + "\",color:" + + "}");
            if(titleType != EnumTitleAction.TITLE && titleType != EnumTitleAction.SUBTITLE) return;
            PacketPlayOutTitle title = new PacketPlayOutTitle(titleType, chatTitle);
            PacketPlayOutTitle length = new PacketPlayOutTitle(fadeInTime, showTime ,fadeOutTime);
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(length);
    It underlines TITLE word from 1st section of code and says:
    TITLE cannot be resolved to a variable

    Well, when I changed it to EnumTitleAction.TITLE . It underlined TitleLib and said The method TitleLib(Player, EnumTitleAction, String, int, int, int, ChatColor) is undefined for the type InviteSystem.
    How can I fix it?
  2. Offline


    @Kargond It's telling you that's not what the method is asking for, it's asking for different things. Look up the documentation and give it what it's actually asking for.
Thread Status:
Not open for further replies.

Share This Page