From 844717b17f8dffd10916e8774d1f20f067b34a3c Mon Sep 17 00:00:00 2001 From: Anthony Wong <64801914+anthonywongskyboxlabs@users.noreply.github.com> Date: Tue, 29 Sep 2026 17:57:02 -0700 Subject: [PATCH] Added a button for teleporting to an entity in the Entity Systems profiler tab --- .../prefabs/tabs/ClientEntitySystems.tsx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/diagnostics_panel/prefabs/tabs/ClientEntitySystems.tsx b/webview-ui/src/diagnostics_panel/prefabs/tabs/ClientEntitySystems.tsx index b4f92bc..6af3897 100644 --- a/webview-ui/src/diagnostics_panel/prefabs/tabs/ClientEntitySystems.tsx +++ b/webview-ui/src/diagnostics_panel/prefabs/tabs/ClientEntitySystems.tsx @@ -335,7 +335,7 @@ function resolveSystemCategoryGroupKey(fullName: string, systemCategoryLegendMap const StatsTab: TabPrefab = { name: 'Client - Entity Systems', dataSource: TabPrefabDataSource.Client, - content: ({ selectedClient }: TabPrefabParams) => { + content: ({ selectedClient, onRunCommand }: TabPrefabParams) => { useDebuggerRequestUpdates(); const [lastRequestedCommand, setLastRequestedCommand] = useState(''); const [entityTimingUnit, setEntityTimingUnit] = useState('ms'); @@ -708,6 +708,17 @@ const StatsTab: TabPrefab = { ): JSX.Element => { const entityId = extractEntityId(row.category); const optionalStats = entityId ? optionalEntityStatsById.get(entityId) : undefined; + const coordinates = [optionalStats?.positionX, optionalStats?.positionY, optionalStats?.positionZ]; + const dimension = optionalStats?.dimension?.trim() ?? ''; + const hasValidTeleportDestination = + selectedClient.trim().length > 0 && + dimension.length > 0 && + coordinates.every(value => typeof value === 'number' && Number.isFinite(value)); + + // Teleports the selected client to this entity's dimension and coordinates if they are valid. + const teleportCommand = hasValidTeleportDestination + ? `/execute in ${dimension} run tp ${JSON.stringify(selectedClient)} ${coordinates.join(' ')}` + : undefined; return (
@@ -737,6 +748,18 @@ const StatsTab: TabPrefab = {
+ { + if (teleportCommand) { + onRunCommand(teleportCommand); + } + }} + > + Teleport to Entity +
Trend ({formatSparklineDurationFromPoints(context.sparklineTickRange)}) @@ -757,7 +780,7 @@ const StatsTab: TabPrefab = {
); }, - [entityTimingUnit, optionalEntityStatsById], + [entityTimingUnit, optionalEntityStatsById, selectedClient, onRunCommand], ); return (