Jump to content

[1.15.2] NoSuchMethodError on packets in server


Recommended Posts


I'm creating am trying to send a packet to the dedicated server but i get this error:

[18:45:59] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
java.lang.NoSuchMethodError: 'java.lang.String net.minecraft.network.PacketBuffer.readString()'
	at fr.modcraftmc.skyblock.network.PacketAddMember.<init>(PacketAddMember.java:17) ~[main/:?] {re:classloading}
	at net.minecraftforge.fml.network.simple.IndexedMessageCodec.lambda$tryDecode$0(IndexedMessageCodec.java:120) ~[forge-1.15.2-31.2.36_mapped_snapshot_20200802-1.15.1-recomp.jar:?] {re:classloading}
	at java.util.Optional.map(Optional.java:265) ~[?:?] {}
	at net.minecraftforge.fml.network.simple.IndexedMessageCodec.tryDecode(IndexedMessageCodec.java:120) ~[forge-1.15.2-31.2.36_mapped_snapshot_20200802-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.network.simple.IndexedMessageCodec.consume(IndexedMessageCodec.java:162) ~[forge-1.15.2-31.2.36_mapped_snapshot_20200802-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.network.simple.SimpleChannel.networkEventListener(SimpleChannel.java:80) ~[forge-1.15.2-31.2.36_mapped_snapshot_20200802-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?] {}
	at net.minecraftforge.fml.network.NetworkInstance.dispatch(NetworkInstance.java:84) ~[?:?] {re:classloading}
	at net.minecraftforge.fml.network.NetworkHooks.lambda$onCustomPayload$1(NetworkHooks.java:78) ~[?:?] {re:classloading}
	at java.util.Optional.map(Optional.java:265) ~[?:?] {}
	at net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(NetworkHooks.java:78) ~[?:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.processCustomPayload(ServerPlayNetHandler.java:1366) ~[?:?] {re:classloading}
	at net.minecraft.network.play.client.CCustomPayloadPacket.processPacket(CCustomPayloadPacket.java:51) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.network.play.client.CCustomPayloadPacket.processPacket(CCustomPayloadPacket.java:12) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[?:?] {re:classloading}
	at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[?:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:759) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:141) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:742) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:736) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:123) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:722) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:666) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at java.lang.Thread.run(Thread.java:834) [?:?] {}

There is my code:


PacketHandler class:

public class PacketHandler {
    private static final String PROTOCOL_VERSION = "1";
    public static SimpleChannel INSTANCE;

    private static int Id = 0;

    private static int nextId(){
        return Id++;

    public static void registerMessageS(){
        INSTANCE =  NetworkRegistry.newSimpleChannel(
                new ResourceLocation(SkyBlock.MOD_ID, "main"),
                () -> PROTOCOL_VERSION,
        INSTANCE.registerMessage(nextId(), PacketOpenGUI.class, PacketOpenGUI::toBytes, PacketOpenGUI::new, PacketOpenGUI::handle);
        INSTANCE.registerMessage(nextId(), PacketOpenSettingsGUI.class, PacketOpenSettingsGUI::toBytes, PacketOpenSettingsGUI::new, PacketOpenSettingsGUI::handle);
        INSTANCE.registerMessage(nextId(), PacketRequestSettings.class, PacketRequestSettings::toBytes, PacketRequestSettings::new, PacketRequestSettings::handle);
        INSTANCE.registerMessage(nextId(), PacketAddMember.class, PacketAddMember::toBytes, PacketAddMember::new, PacketAddMember::handle);
        INSTANCE.registerMessage(nextId(), PacketRemoveMember.class, PacketRemoveMember::toBytes, PacketRemoveMember::new, PacketRemoveMember::handle);


PacketAddMember class:

public class PacketAddMember {

    String owner;
    String newMember;
    public PacketAddMember(PacketBuffer buf){
        owner = buf.readString();
        newMember = buf.readString();

    public void toBytes(PacketBuffer buf){

    public PacketAddMember(String owner, String newMember){
        this.owner = owner;
        this.newMember = newMember;

    public void handle(Supplier<NetworkEvent.Context> ctx){
        ctx.get().enqueueWork(() -> {
            Islands.addMember(owner, newMember);


Bit of code of where i send the packet to the server:

private void addMember(Button button){
        System.out.println("playerList.getSelected().toString() = " + playerList.getSelected().toString());
        PacketHandler.INSTANCE.sendToServer(new PacketAddMember(Minecraft.getInstance().player.getDisplayName().getString().toLowerCase(), playerList.getSelected().toString()));
        String newMember = playerList.getSelected().toString().toLowerCase();
        memberList.set(memberList.indexOf(newMember+"=false"), newMember+"=true");
        playerList = new PlayerList(Minecraft.getInstance(), 300, 110, 10, 100, 15);
        addMember.active = false;
        removeMember.active = false;


The error occurs when i press the button which have for listener this method above.

Thank you for your help

Link to comment
Share on other sites

There are two readString methods, one takes an argument the other doesn't.

The no-arg one you're using is only present on the client.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.


As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.


For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.


Logs (Most issues require logs to diagnose):


Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.


What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...


...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension


Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.


Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.






or alternately, 


Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft


Server Not Starting:


If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.


Reporting Illegal/Inappropriate Adfocus Ads:


Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.


Posting your mod as a GitHub Repo:


When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.


  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]


Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have a structure, and sometimes several mobs spawn there. This is a boss and must spawn alone. Here is the code for spawning entities in the structure { "type": "minecraft:jigsaw", "start_pool": "egyptcraft:boss_pyramid/start_pool", "size": 5, "max_distance_from_center": 80, "biomes": "#egyptcraft:has_structure/boss_pyramid", "step": "surface_structures", "start_height": { "absolute": 0 }, "project_start_to_heightmap": "WORLD_SURFACE_WG", "use_expansion_hack": false, "spawn_overrides": { "monster": { "bounding_box": "full", "spawns": [ { "type": "egyptcraft:anubis", "maxCount": 1, "minCount": 1, "weight": 100 } ] } } } Maybe it's something else?
    • I have OreGenEvent.GenerateMinable event, I need to get a chance to spawn (generate) every ore that is processed in this event. Also e.getType().name().toString() is name this is the same block name by which it can be entered in the Block.getByID?  forge 1.12.2 59(recommended)
    • Hello everybody! Out of nowhere my minecraft doesn't allow me to play on forge 1.19.2 I tried to reinstall minecraft, doesn't have any mod right now on the forge version. Tried the newest version of forge, tried recommended version as well. I have the newest version of Java as well...   I dont know why it stopped working but it just stopped completly out of nowhere...   Thank you so much for your help guys ❤️
    • Hello, my world is crashing at 0% loaded and I don't know why. (Forge 43.2.14, 1.19.2) I have two worlds that I play on, and one works and the other doesn't, even with the same mod list. Here's the crash report: https://pastebin.com/AUbRwkGj
    • Minecraft 1.12.2 Very frustrating error. only ever occurs on one device. Started yesterday without prompting (maybe java updated or something?) Says things that have been imported actually arent when running client Reinstalled Intellij, cleared cache, cleaned and rebuilt gradle, redownloaded the entire file from git. Nothing works. (I believe I have the right plugins installed, dependencies OK, and am using corretto 1.8).   One thing I did for more of the below errors was just to explicitly import them, which was working up until this little guy who literally does not exist in forge to import. the class inhereting something inhereting it refers to import net.minecraftforge.registries.IForgeRegistryEntry.Impl, not net.minecraftforge.registries.IForgeRegistryEntry$Impl as the output implies. also I didn't even have to manually import these things for it to work on my other device. (which is just importing the minecraft package that contains them), but here I did have to just to get rid of a few errors--not even make anything work?? I dont know. (edited) here's the aforementioned "below error" (one of many like it): error: cannot access net.minecraftforge.registries.IForgeRegistryEntry.Impl public class BlockBase extends Block {        ^   class file for net.minecraftforge.registries.IForgeRegistryEntry$Impl not found Here's the class BlockBase:   package com.quantum.exodus.common.blocks; import com.quantum.exodus.ExodusMod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.registries.IForgeRegistryEntry.Impl; public class BlockBase extends Block { protected String name; public BlockBase(Material material, String name) { super(material); this.name = name; setTranslationKey(name); setRegistryName(name); } public void registerItemModel(Item itemBlock) { ExodusMod.proxy.registerItemRenderer(itemBlock, 0, name); } public Item createItemBlock() { return new ItemBlock(this).setRegistryName(getRegistryName()); } @Override public BlockBase setCreativeTab(CreativeTabs tab) { super.setCreativeTab(tab); return this; } }
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.