Open Inventory with different display name
@@ -106,6 +106,17 @@ default boolean isViewingInventory() {
*/
Optional<Container> openInventory(Inventory inventory) throws IllegalArgumentException;
+ /**
+ * Opens a given Inventory for the player to view with a custom displayName.
+ *
+ * <p>Note that not all inventories support a custom display name.</p>
+ *
+ * @param inventory The inventory to view
+ * @param displayName The display name to set
+ * @return The opened Container if the inventory was opened, otherwise {@link Optional#empty()}
+ */
+ Optional<Container> openInventory(Inventory inventory, Text displayName);
+
/**
* Closes the currently viewed entity of this player, if it is currently
* viewing one.
