diff --git a/MinecraftClient/Commands/Inventory.cs b/MinecraftClient/Commands/Inventory.cs
index eeeee3d0..5936afd0 100644
--- a/MinecraftClient/Commands/Inventory.cs
+++ b/MinecraftClient/Commands/Inventory.cs
@@ -435,6 +435,12 @@ namespace MinecraftClient.Commands
return r.SetAndReturn(CmdResult.Status.Fail, msg);
}
+ if (container.Type != ContainerType.PlayerInventory)
+ {
+ handler.Log.Warn(string.Format(Translations.cmd_inventory_tui_unsupported_container, inventoryId));
+ return r.SetAndReturn(CmdResult.Status.Fail);
+ }
+
handler.Log.Info(string.Format(Translations.cmd_inventory_tui_opening, inventoryId));
bool success = InventoryTuiHost.Launch(handler, inventoryId);
diff --git a/MinecraftClient/Resources/Translations/Translations.Designer.cs b/MinecraftClient/Resources/Translations/Translations.Designer.cs
index 10fddca1..d20d36af 100644
--- a/MinecraftClient/Resources/Translations/Translations.Designer.cs
+++ b/MinecraftClient/Resources/Translations/Translations.Designer.cs
@@ -6332,6 +6332,15 @@ namespace MinecraftClient {
}
}
+ ///
+ /// Looks up a localized string similar to TUI viewer does not support this container type (Inventory #{0}). Use '/inventory {0} list' to view its contents..
+ ///
+ internal static string cmd_inventory_tui_unsupported_container {
+ get {
+ return ResourceManager.GetString("cmd.inventory.tui_unsupported_container", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Hold Shift + Left-click to select and copy text..
///
diff --git a/MinecraftClient/Resources/Translations/Translations.resx b/MinecraftClient/Resources/Translations/Translations.resx
index a877ef80..5eb2fa76 100644
--- a/MinecraftClient/Resources/Translations/Translations.resx
+++ b/MinecraftClient/Resources/Translations/Translations.resx
@@ -2229,6 +2229,9 @@ Logging in...
Failed to launch TUI inventory viewer.
+
+ TUI viewer does not support this container type (Inventory #{0}). Use '/inventory {0} list' to view its contents.
+
Hold Shift + Left-click to select and copy text.