Sponge icon indicating copy to clipboard operation
Sponge copied to clipboard

InventoryClickEvent - Spectator mode

Open TheSebakl opened this issue 8 years ago • 4 comments

i'm using SpongeForge version: spongeforge-1.10.2-2477-5.2.0-BETA-2637 and i have a problem with the event InventoryClickEvent when player is in gamemode spectator. the event still not fired like before.

for a while, i have used this event to my moderator's pannel to switch between spectator mode and survival mode. but since my last update (and i needed it) the event doen't work.

If you could repair it, it'll be good for me. thx and i have an other bug to report with this event. (before my last update i had this problem.) when you was in spectator mode, you could get event, but not the clicked item. if you could test it'll be perfect.

thx for your job.

TheSebakl avatar Oct 01 '17 12:10 TheSebakl

NetHandlerPlayServer#processClickWindow just sends the unmodified inventory back to the client. That is why we have no event that fires. There are no changes.

Not sure how to handle this...

Faithcaio avatar Feb 04 '18 13:02 Faithcaio

@Faithcaio Can we override that behavior? At minimum I would have expected there still to be a click event, even if nothing changed, if we could detect the click, like, a pre click event of some sort, just so you can catch the interaction for menu's etc. (assuming it's possible, which it sounds like it used to be)

ryantheleach avatar Feb 04 '18 18:02 ryantheleach

We always fire the inventory events AFTER changes happened. So we would need a new event for this.

Maybe smth. like ClickInventoryEvent.Spectator but not extending ClickInventoryEvent as we cant provide any transactions.

Faithcaio avatar Feb 04 '18 19:02 Faithcaio

^ API9

Faithcaio avatar May 08 '22 13:05 Faithcaio