Package com.cryptomorin.xseries.messages
Class Titles
java.lang.Object
com.cryptomorin.xseries.messages.Titles
- All Implemented Interfaces:
Cloneable
A reflection API for titles in Minecraft.
Fully optimized - Supports 1.8.8+ and above.
Requires ReflectionUtils.
Messages are not colorized by default.
Titles are text messages that appear in the middle of the players screen: https://minecraft.gamepedia.com/Commands/title PacketPlayOutTitle: https://wiki.vg/Protocol#Title
- Version:
- 3.0.0
- Author:
- Crypto Morin
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearTitle(org.bukkit.entity.Player player) Clears the title and subtitle message from the player's screen.clone()getTitle()static TitlesparseTitle(org.bukkit.configuration.ConfigurationSection config) static TitlesparseTitle(org.bukkit.configuration.ConfigurationSection config, Function<String, String> transformers) Parses a title from config.voidsend(org.bukkit.entity.Player player) static voidsendTabList(String header, String footer, org.bukkit.entity.Player... players) Supports pre-1.13 tab method.static voidsendTitle(org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut, String title, String subtitle) Sends a title message with title and subtitle to a player.static voidSends a title message with title and subtitle with normal fade in, stay and fade out time to a player.static TitlessendTitle(org.bukkit.entity.Player player, org.bukkit.configuration.ConfigurationSection config) Parses and sends a title from the config.voidsetSubtitle(String subtitle) void
-
Constructor Details
-
Titles
-
-
Method Details
-
clone
-
send
public void send(org.bukkit.entity.Player player) -
sendTitle
public static void sendTitle(@Nonnull org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut, @Nullable String title, @Nullable String subtitle) Sends a title message with title and subtitle to a player.- Parameters:
player- the player to send the title to.fadeIn- the amount of ticks for title to fade in.stay- the amount of ticks for the title to stay.fadeOut- the amount of ticks for the title to fade out.title- the title message.subtitle- the subtitle message.- Since:
- 1.0.0
- See Also:
-
sendTitle
public static void sendTitle(@Nonnull org.bukkit.entity.Player player, @Nonnull String title, @Nonnull String subtitle) Sends a title message with title and subtitle with normal fade in, stay and fade out time to a player.- Parameters:
player- the player to send the title to.title- the title message.subtitle- the subtitle message.- Since:
- 1.0.0
- See Also:
-
parseTitle
-
parseTitle
public static Titles parseTitle(@Nonnull org.bukkit.configuration.ConfigurationSection config, @Nullable Function<String, String> transformers) Parses a title from config. The configuration section must at least containtitleorsubtitleExample:
ConfigurationSection titleSection = plugin.getConfig().getConfigurationSection("restart-title"); Titles.sendTitle(player, titleSection);- Parameters:
config- the configuration section to parse the title properties from.- Since:
- 3.0.0
-
getTitle
-
getSubtitle
-
setTitle
-
setSubtitle
-
sendTitle
public static Titles sendTitle(@Nonnull org.bukkit.entity.Player player, @Nonnull org.bukkit.configuration.ConfigurationSection config) Parses and sends a title from the config.- Parameters:
player- the player to send the title to.config- the configuration section to parse the title properties from.- Since:
- 1.0.0
-
clearTitle
Clears the title and subtitle message from the player's screen.- Parameters:
player- the player to clear the title from.- Since:
- 1.0.0
-
sendTabList
public static void sendTabList(@Nonnull String header, @Nonnull String footer, org.bukkit.entity.Player... players) Supports pre-1.13 tab method. Changes the tablist header and footer message for a player. This is not fully completed as it's not used a lot.Headers and footers cannot be null because the client will simply ignore the packet.
- Parameters:
header- the header of the tablist.footer- the footer of the tablist.players- players to send this change to.- Since:
- 1.0.0
-