Title INV question

Discussion in 'Plugin Development' started by icedmoca, Mar 9, 2016.

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

    icedmoca

    Well my problem is, I do not know how to use this can someone make this message a subtitle here is my code:

    Code:
            p.sendMessage(ChatColor.LIGHT_PURPLE + ">> " + ChatColor.WHITE + "Get Your Gas Mask On!");
    So can someone make it a subtitle message? and post the code, i have no clue how to use the title, but then how do I keep it for like 3 sec then fade out?
     
  2. Offline

    mine-care

    We are against spoonfeeding, See why.

    Do you mean Action bar message?
     
  3. Offline

    icedmoca

    Those are not rules.
     
  4. Offline

    mine-care

    @Kyleyocats They are unwritten rules, The majority agrees on in these forums. Think of them like ethics, ethics are not written anywhere. They are morral rules. Lets stop this discussion here and if you want, continue on the thread i posted above ^.

    Now,
     
  5. Offline

    Zombie_Striker

    @Kyleyocats
    Yeah, if you want to discuss the "unwritten rules", post in that thread.

    If you want to send a player a "Title" (message in the middle of the screen), use Player#sendTitle();
     
  6. Offline

    Evonoucono

  7. Offline

    icedmoca

    yes, for the action bar do put: p.sendTitle(arg0, arg1);

    but what is arg0 and arg1 and how do i add a 3 second fade out?
     
  8. Offline

    Zombie_Striker

    mine-care likes this.
  9. Offline

    Evonoucono

    @Kyleyocats
    As far as I know whenever you try and change the timer of "stay" time for the message or the fade in/out time, it doesn't do anything. The default is approximately a .3 second fade in followed by a 3-4 second stay time, and then a .5 second fade out. I've tried at least a million things and couldn't get it to stay longer like I wanted. I don't think you can have the 3 second fade out like you want...
     
  10. Offline

    icedmoca

    Thanks Guys! You really helped and it works Thanks!

    Never mind, not solved it gives me this cross thru error, https://gyazo.com/763c57ef88a561ce35675ca37728cce0

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 9, 2016
  11. Offline

    mine-care

    @Kyleyocats this is not an error, it is deprecation. I see you added "SupressWarnings" to it, which indicates that you aknowledge the issue that isnt the case i think. Well check the docs and see why it is deprecated and what alternatives there are.
     
  12. Offline

    mcdorli

    I help you, none. You can fiddle around with pacckets though.
    If you don't want to use deprecated stuff (deprecated means, it will be removed in the future and break your plugin (I doubt it is the same in this case though)), then you need to send a packetPlayOutChat to the player

    Code:
    IChatBaseComponent icbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
    PacketPlayOutChat chat = new PacketPlayOutChat(icbc, 2);
    ((CraftPlayer)player).getHandle().playerConnection.sendPacket(chat);
    
     
  13. Offline

    Irantwomiles

    Pogostickdev that a good tutorial on fading in and out if you're still stuck
     
Thread Status:
Not open for further replies.

Share This Page