Close Storage Event - Problem/Fehler

A new status update as well as a first preview video of the new version are now available!
  • Hello,


    first of all , I want to thank everyone for the Rising World Development. Plugins keeps rising more and more.

    The problem is so. I want to make an ,,backpack'' plugin , when pressing B key. All works fine , I implemented Sound effect , Some Messages and finally an Stroage (getWorld().createNewStorage(10) ). The problem is , I need to find the callback for the Storage closing from the right top corner ( the [X] button). I tryed many callbacks but none seems to work.

    Please provide me support if have any tested/working sollution of possible callback.

    Thank you,

    Stefan.

  • Hello,

    So , I made it open & close with a toggle function. All works fine. But , there is the chance when a player won*t use the assigned Button to close the Storage properly , so the key event will be triggered and I will save his items in the database. It might happen that the Player can press in the right upper corner ( [X] Button ) and no event will be triggered. His items will be lost.. This is why I need an event to know whenever he closes his backpack.

    Danke und gruß,

    Stefan

  • But , there is the chance when a player won*t use the assigned Button to close the Storage properly , so the key event will be triggered and I will save his items in the database

    Do you store the items in a separate database, or do you just want to make sure the items added to the storage will be saved properly? Changes to storages created via world.createNewStorage() will be saved automatically (every ~15 seconds and also when quitting the game / shutting down the server), so there is basically no need to save that manually.


    However, a proper event when the player opens / closes a certain UI (inventory, crafting menu, storages etc) can be quite helpful, so I'll put that on our to-do list, at least for the new version ;)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!