#I'm making a screen, but it says the screen is not properly initialized.

1 messages · Page 1 of 1 (latest)

lament agate
#

what could be the problem.. 🤔

#

[fabric-screen-api-v1] The current screen (net.minecraft.client.gui.screen.Screen) has not been correctly initialised, please send this crash log to the mod author. This is usually caused by the screen not calling super.init(Lnet/minecraft/client/MinecraftClient;II)V

this is the full error log

lament agate
#

which client

#

Lnet/minecraft/client?

#

net.minecraft.client?

lament agate
clear mango
lament agate
#

Argument 'client' might be null?

clear mango
#

Try putting MinecraftClient.getInstance()

lament agate
#

Problem is I tried that and it spits the same error

lusty widget
#

Could you just leave out the super.init call?

lament agate
#

I also tried that. same result..

#

can any external reason cause that error?

lusty widget
#

how do you open the screen?

lament agate
#

with client packet

#

it looks like this

public class SetHomeScreenS2CPacket {
    public static void recieve(MinecraftClient client, ClientPlayNetworkHandler clientPlayNetworkHandler, PacketByteBuf packetByteBuf, PacketSender packetSender) {
        client.setScreen(new HomeScreen());
    }
}
#

@lusty widget Ping in case you miss. sry if it bothered you)

lusty widget
#

could you wrap it around a MinecraftClient.execute call?

lament agate
#

oh sure

#

omg

#

it works

#

after many hours of struggling

#

thank you SO much man.

foggy totem