Close Inventory Bedrock
TylorTurner opened this issue · 7 comments
Server Version
1.20.4
Resource Version
v6.0.7
Dump Information
g
Describe The Problem
Currently I am trying to use close inventory but for bedrock players it will not close their inventory, is there a way I could do that?
Additional Context
items:
items:
any-text:
id: 345
slot: 31
name: '&3ᴄᴏᴍᴍᴀɴᴅ ᴄᴇɴᴛᴇʀ'
lore:
- ' &aᶜˡⁱᶜᵏ ᵐᵉ'
- '&f&n&lʀᴇᴀʟᴄʀᴀғᴛ.ʟɪᴠᴇ'
enabled-worlds: world, spawn
triggers: join, respawn, world-switch, region-enter, gamemode-switch
inventory:
- 'player: [close]'
- 'player:cc'
itemflags: inventory-modify, death-drop
Checklist
- I am running latest version of this resource.
- I have read the wiki to make sure it's not an issue with configuration.
- I ticked all of these boxes without actually reading them.
- I have checked that my help request is unique and another request does not exist.
- I acknowledge this is not a bug report and is instead a help request.
So upon checking this seems to be entirely dependent on what you are using as a bridge for bedrock players. On the ItemJoin side, there is nothing I can do as it is properly interfacing with the spigot server (or similar server software) and uses the built-in API to close the player inventory.
If it's not closing properly for bedrock players, I can only assume it's an issue with whatever you are using as a bridge for bedrock players. I am a bit surprised though as it's a pretty simple method that should be supported since it's interacting directly with the server which sends the data to the client.
If you end up reaching out to the dev (of whatever you're using as a bridge for bedrock players) then feel free to let them know the method I use for closing player inventories is;
player.openInventory(Bukkit.createInventory(player.getInventory().getHolder(), 9));
player.closeInventory();
This simply creates and opens a fake inventory which then is able to subsequently closed by the #closeInventory method.
So from your other issue you posted I see you're using GeyserMC as the bridge which helps me test.
I am not quite sure what you mean by using ItemJoin in Command Panels, are you saying you are using ItemJoin to open a command panel? If that is the case you shouldn't need ItemJoin to close the inventory as it is opening the command panel inventory.
It may help to provide some screenshots or a video as I don't quite understand what you are trying to close.
So from your other issue you posted I see you're using GeyserMC as the bridge which helps me test.
I am not quite sure what you mean by using ItemJoin in Command Panels, are you saying you are using ItemJoin to open a command panel? If that is the case you shouldn't need ItemJoin to close the inventory as it is opening the command panel inventory.
It may help to provide some screenshots or a video as I don't quite understand what you are trying to close.
Here is an explanation of what I am doing.
https://streamable.com/0jzfzs
So from your other issue you posted I see you're using GeyserMC as the bridge which helps me test.
I am not quite sure what you mean by using ItemJoin in Command Panels, are you saying you are using ItemJoin to open a command panel? If that is the case you shouldn't need ItemJoin to close the inventory as it is opening the command panel inventory.
It may help to provide some screenshots or a video as I don't quite understand what you are trying to close.Here is an explanation of what I am doing. https://streamable.com/0jzfzs
Oh my god, this is so useful, thank you!
That is really odd, it seems the way Microsoft is handling player inventories is different in Bedrock. I am not entirely sure if this is something I can fix without directly relying on GeyserMC.
I will say I have never used GeyserMC and have barely touched Bedrock edition, so please be patient with me as I work on getting a testing environment set up so I can work on debugging this issue, it may take me a little bit.
Thanks again for the video, it is exactly what I needed.