How to use Title

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
5
1
0
1
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