[SPIGOT-1324] Inventory#getTitle() doesn't work for enchantment tables Created: 05/Dec/15  Updated: 03/Jul/19  Resolved: 03/Jul/19

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Daniel Saukel Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.8.8, bug, bukkit
Environment:
  • Latest Spigot 1.8.8
  • Plugin with an InventoryOpenEvent listener that logs the title of the inventory


 Description   

The method org.bukkit.inventory.Inventory#getTitle() returns the default title of the inventory, not the custom one for enchantment tables. It works fine with chests, trapped chests, furnaces and horses, though.



 Comments   
Comment by md_5 [ 03/Jul/19 ]

Resolved in 1.14

Comment by Oliver Dunk [ 28/Dec/15 ]

I've just confirmed this issue on the latest version of Spigot - I'm working on a fix and will keep you up to date with the progress.

Comment by Daniel Saukel [ 06/Dec/15 ]

Ingame: With an anvil, Creative Mode and the enchantment table. Later with Bukkit#createInventory() / Player#openInventory().

This was my test code:

	@EventHandler
	public void onOpen(InventoryOpenEvent event) {
		if ( !event.getInventory().getTitle().equals("Custom")) {
                        Bukkit.broadcastMessage(event.getInventory().getTitle());
			return;
		}
        }

The output is "Enchant", even though the visible title of the GUI is "Custom".

Comment by md_5 [ 05/Dec/15 ]

How are you creating the inventory?

Comment by SpigotMC [ 05/Dec/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 1515 version(s) behind. CraftBukkit is 2 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Tue Apr 22 05:44:20 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.