Close Storage Event - Problem/Fehler

A new update is now available, introducing a lot of new content!
Latest hotfix: 0.7.5.2 (2024-09-10)
  • 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.

  • Unfortuantely there is no such event in the API yet :/ What do you need it for exactly? Maybe there is a workaround available (especially if you need the event for UI specific things).

  • 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 ;)

  • Moin,

    Ah ... verstehe ... na ja ... über den ,,auto save’’ wüste ich eigentlich nicht. Super , dann diese Tip würde die Plugin Entwicklung einfacher machen soll.

    Vielen dank und viel Erfolg dabei!

    Gruß,

    Stefan.

Participate now!

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