Resolved NPC HTML dialog window remains open after teleporting via bypass command

Nothing

Heir
Customer
I have an NPC service that provides teleportation through HTML dialogs. When a player clicks a teleport button, the teleport works correctly, but the HTML window stays open showing the teleport menu instead of closing automatically.

Current Behavior:
1. Player interacts with NPC and opens the teleport menu
2. Player clicks on any teleport location (e.g., "Aden", "Giran", etc.)
3. Player successfully teleports to the location
4. Problem: The teleport menu HTML window remains open on the screen after teleporting (see screenshot)

1760901376604.webp

Current Code:
case "tele":
{
if (args.length != 2)
{
return;
}
final String teleportName = args[1];
useTeleport(player, teleportName);
break;
}

public static void useTeleport(Player player, String teleportName)
{
final Location location = TELEPORTS.get(teleportName);
if (location == null)
{
return;
}
player.teleToLocation(location);
}

What I've tried:
- Sending an empty NpcHtmlMessage after teleporting
- Sending new NpcHtmlMessage(player, null) with empty HTML
- Not sending any packet after teleporting

None of these approaches close the dialog window.

Is there a specific packet or method I should call to force the client to close the dialog?
 
Back
Top