How to use Title

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

yap241986

New member
May 20, 2023
7
0
1
I'm creating a plugin using Paper API 1.20.4. I would like to show a title to a player. If I try to use player.sendTitle(String, String, int, int, int) the IDE tells me that it's deprecated. So I tried to use player.showTitle(Title), but I can't understand how to create a Title().
 
Solution
Just use it like that.

player.showTitle(Title.title( Component.text("Hellow"), Component.text("sub"), Title.Times.times(Duration.ofSeconds(10), Duration.ofSeconds(300), Duration.ofSeconds(30)) ));

ysl3000

New member
Feb 9, 2023
10
2
1
3
Just use it like that.

player.showTitle(Title.title( Component.text("Hellow"), Component.text("sub"), Title.Times.times(Duration.ofSeconds(10), Duration.ofSeconds(300), Duration.ofSeconds(30)) ));
 
Last edited:
Solution