Hello guys !
I’m looking how to set the “up title” and the “item title” with the Sponge API. I don’t know if these parts have a name so I added a picture (the red parts):
Let’s say I have a Text
object, ready to be displayed. How can I display it in the “up title” or “item title” part ? Thank you in advance !
Nomeho - EzpzTeam
1 Like
There is an open issue to add an ‘up title’ (Boss Bar) API
‘item title’ (or Action Bar) is a ChatType
, ChatTypes.ACTION_BAR
https://github.com/SpongePowered/SpongeAPI/blob/master/src/main/java/org/spongepowered/api/text/chat/ChatTypes.java#L52
use the sendMessage(ChatType, Text...)
method (or similar)
* @param musicDiscType The music disc */ void playMusicDisc(Vector3i position, MusicDisc musicDiscType); /** * Plays the given {@link MusicDisc} at the given position. The benefit of playing * {@link MusicDisc} instead of a {@link SoundType} allows you to stop them through * the {@link #stopMusicDisc(Vector3i)}. Playing a new {@link MusicDisc} at the same * position will cancel the currently playing one. * * @param position The position * @param musicDiscType The music disc */ void playMusicDisc(Vector3i position, Supplier<? extends MusicDisc> musicDiscType); /** * Stops the {@link MusicDisc} that is playing at the given position. * * @param position The position */ void stopMusicDisc(Vector3i position);
example:
player.sendMessage(ChatTypes.ACTION_BAR, Texts.of("Some text"));
4 Likes
Thank you it is exactly what I was looking for !
2 Likes