Hey there, right now I'm trying to get my code to open the player's inventory using:
MinecraftClient.getInstance().setScreen(new InventoryScreen(player));
This tells me I can't open the inventory screen outside of the render thread. As explained in this error:
[pool-4-thread-1/ERROR] (fabric-screen-api-v1) Attempted to set screen to "net.minecraft.client.gui.screen.ingame.InventoryScreen@2790f2c1" outside the render thread ("pool-4-thread-1"). This will likely follow a crash! Make sure to call setScreen on the render thread.
How would I go about accessing this thread to tell it to open my inventory and how could I keep the code telling it to do that in its own thread. Right now I have a separate thread asking the inventory to open and it needs to open the inventory at a specific time.
My thoughts are maybe I need to find a method within the code running on the render thread that could schedule the inventory to open on the render frame or I will need to create this method myself through a mixin? What do you think? This is Minecraft 1.19.4 by the way

