Opening the chest without showing the GUI

Discussion in 'Plugin Development' started by Wituz, Aug 6, 2012.

Thread Status:
Not open for further replies.
  1. Hello there.
    I am developing a plugin for my rpg server.
    The goal of the plugin is to loot chests, where the contents of them is specified by the admin.
    Anyways, I want the chest to do the open animation without opening any kind of inventory/gui.

    How can I do that? ;)

    Or is it even possible?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  2. Offline

    zajacmp3

    It should be.
    All you need is in package org.bukkit.event.invetory

    Just add a listener when player is opening chest cancel his action of opening invetory.
     
    Wituz likes this.
  3. Awesome, thanks ;)

    What about closing then?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  4. Offline

    TheDigerdad

    when closing i would guess your closing the inventory so it wouldn't show the gui because minecraft is coded to show the gui while your in the chest not while you are out of the chest so i think you need to hide the gui while the chest is open only
     
  5. Yes, but i i need to close the chest after i've opened it ;) Or else it just stays open
    My recent solution (didn't test it) was to save the chest block, then do a ultra-quick open/close with gui, so that the chest closes. What do you think of that?
     
  6. Offline

    TheDigerdad

    yes i like the idea only what i mean is while the chest is open the gui is hidden so when the player leaves the chest itll close because the player isnt using it you just hide the gui and thats all i think (know a bit of java)
    but i might be wrong you learn from mistakes also i recommend you dont flash the gui try my way first the do the flashing gui thing as i said i might be right might be wrong
     
Thread Status:
Not open for further replies.

Share This Page