Jump to content

[1.12.2 Client Side] Get chest displayname from GuiOpenEvent


Recommended Posts

Posted (edited)

I am a beginner. It could be a stupid question. 

I'd like to get the displayname of the chest that is open in GuiOpenEvent.

GuiChest does not have getDisplayName.

    @SideOnly(Side.CLIENT)
    @SubscribeEvent(priority= EventPriority.NORMAL, receiveCanceled=true)
    public void guiOpenEvent(GuiOpenEvent event) {
        if (event.getGui() instanceof GuiChest) {
            GuiChest guiChest = (GuiChest) event.getGui();
            String displayName = guiChest.getDisplayName(); //Cannot resolve method 'getDisplayName' in 'GuiChest'
        }
    }

 

Edited by Minsoo
Invalid Title
  • Minsoo changed the title to [1.12.2 Client Side] Get chest displayname from GuiOpenEvent
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.