Event Titles
Package: com.hypixel.hytale.server.core.util.EventTitleUtil
Full-screen title/subtitle overlays with fade animations. Titles are queued — if one is already displaying, the next waits until it finishes. Used internally for zone discovery and instance entry.
Default Timing
Section titled “Default Timing”| Constant | Value | Description |
|---|---|---|
DEFAULT_DURATION | 4.0s | How long the title stays visible |
DEFAULT_FADE_DURATION | 1.5s | Fade in and fade out duration |
Showing Titles
Section titled “Showing Titles”// simple title with default timingEventTitleUtil.showEventTitleToPlayer( playerRef, Message.translation("mymod.zone.entered"), // primary title Message.translation("mymod.zone.name"), // secondary title false // isMajor);
// full control over timing and iconEventTitleUtil.showEventTitleToPlayer( playerRef, Message.translation("mymod.boss.spawned"), Message.translation("mymod.boss.name"), true, // isMajor (larger/more prominent) "Common/UI/Icons/BossSkull", // icon asset path 5.0f, // duration (seconds) 1.0f, // fade in (seconds) 2.0f // fade out (seconds));Hiding Titles
Section titled “Hiding Titles”// dismiss immediatelyEventTitleUtil.hideEventTitleFromPlayer(playerRef, 0.0f);
// dismiss with fade outEventTitleUtil.hideEventTitleFromPlayer(playerRef, 1.5f);Targeting
Section titled “Targeting”// all players in a worldEventTitleUtil.showEventTitleToWorld( primary, secondary, isMajor, icon, duration, fadeIn, fadeOut, store);EventTitleUtil.hideEventTitleFromWorld(1.5f, store);
// all players on the serverEventTitleUtil.showEventTitleToUniverse( primary, secondary, isMajor, icon, duration, fadeIn, fadeOut);Zone and Instance Discovery
Section titled “Zone and Instance Discovery”The built-in zone and instance systems use event titles internally. Both fire cancellable events:
Zone discovery — fires when a player enters a new zone on the world map:
eventRegistry.registerGlobal(DiscoverZoneEvent.Display.class, event -> { // event contains ZoneDiscoveryInfo: // zoneName, regionName, icon, isMajor, duration, fadeIn, fadeOut, // discoverySoundEventId
// cancel to suppress the title event.setCancelled(true);});Instance discovery — fires when a player enters a new instance world:
eventRegistry.registerGlobal(DiscoverInstanceEvent.Display.class, event -> { // contains InstanceDiscoveryConfig event.setCancelled(true); // cancel the event entirely // or just suppress the title display event.setDisplay(false);});HUD Visibility
Section titled “HUD Visibility”The EventTitle component can be toggled per-player via the HUD system:
// hide event titles for a playerhud.hideHudComponents(playerRef, HudComponent.EventTitle);Packets
Section titled “Packets”See ShowEventTitle and HideEventTitle for the wire format.