Posted April 22, 20232 yr Greetings, I am currently trying to register a packet listener for forge 1.8.9 like this: public class NameChangePacketListener { @SubscribeEvent @SideOnly(Side.CLIENT) public void onPacketReceived(FMLNetworkEvent.ClientCustomPacketEvent event) throws IOException { System.out.println("test"); if (event.packet.toS3FPackets() instanceof S38PacketPlayerListItem) { S38PacketPlayerListItem packet = (S38PacketPlayerListItem) event.packet.toS3FPackets(); if (packet.func_179768_b() == S38PacketPlayerListItem.Action.UPDATE_DISPLAY_NAME) { for (S38PacketPlayerListItem.AddPlayerData playerData : packet.func_179767_a()) { String newName = playerData.getDisplayName().getUnformattedText(); IChatComponent chatComponent = new ChatComponentText("Your name has been changed") .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)); Minecraft.getMinecraft().thePlayer.addChatMessage(chatComponent); } } } } } Now, in the init method, I register this listener to the event bus like so: @Mod.EventHandler @SideOnly(Side.CLIENT) public static void init(FMLInitializationEvent event){ MinecraftForge.EVENT_BUS.register(new NameChangePacketListener()); } I know for a fact the init method works, so why does the "onPacketReceived" method not get called? the "test" doesn't print at all
April 22, 20232 yr 1.8.9 is no longer supported as it is really really old https://forums.minecraftforge.net/topic/91712-supported-version-directory/ That being said, unfortunately I don't know how to help in this case, but since this version is unsupported I don't know if some will eventually come (hopefully it will, but it's unlikely) Don't blame me if i always ask for your help. I just want to learn to be better
April 22, 20232 yr Author Thank you for your interest in helping me. Do you know another forum where I could post my problem at?
April 22, 20232 yr The only place I can think of is the Forge discord (or any other modding discord servers). But beside Forge and Kaupenjoe I don't know other Forge discord servers Don't blame me if i always ask for your help. I just want to learn to be better
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.