rowan-vr / CustomAdvancements

Custom Advancements is an easy to configure minecraft plugin where you can create your own advancements for your server. Your players can use the easy to use GUI to see the advancements and their progress and how to activate them!
https://www.spigotmc.org/resources/custom-advancements.91167/
GNU General Public License v2.0
34 stars 7 forks source link

🛑 Cant join world (PacketTooLarge - PacketPlayOutAdvancements is 82787950. Max is 8388608) #147

Open User4716 opened 1 year ago

User4716 commented 1 year ago

When I have like 100 advancements on my server (5 Advancement trees) and when I have all of them they just break so I decided to test it with only one tree. That advancement tree has only 10 advancements in it (File size 7kb, Lines: 248)

And when I join the world is frozen for 3 seconds, and after that I get kicked for: Disconnected And in the server console, it says that:

[13:57:11 INFO]: UUID of player --- is AAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
[13:57:12 INFO]: --- joined the game
[13:57:12 INFO]: --- [/127.0.0.1:54383] logged in with entity id 250 at ([world]8.699999988079071, 90.0, -113.69999998807907)
[13:57:15 WARN]: net.minecraft.network.PacketEncoder$PacketTooLargeException: PacketTooLarge - PacketPlayOutAdvancements is 82787950. Max is 8388608
[13:57:15 WARN]:    at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:61)
[13:57:15 WARN]:    at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:14)
[13:57:15 WARN]:    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856)
[13:57:15 WARN]:    at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:851)
[13:57:15 WARN]:    at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1010)
[13:57:15 WARN]:    at io.netty.channel.AbstractChannel.write(AbstractChannel.java:296)
[13:57:15 WARN]:    at net.minecraft.network.Connection.doSendPacket(Connection.java:473)
[13:57:15 WARN]:    at net.minecraft.network.Connection.lambda$sendPacket$10(Connection.java:442)
[13:57:15 WARN]:    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
[13:57:15 WARN]:    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
[13:57:15 WARN]:    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
[13:57:15 WARN]:    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
[13:57:15 WARN]:    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
[13:57:15 WARN]:    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[13:57:15 WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
[13:57:17 WARN]: io.netty.channel.StacklessClosedChannelException
[13:57:17 WARN]:    at io.netty.channel.AbstractChannel.close(ChannelPromise)(Unknown Source)
[13:57:17 WARN]: io.netty.channel.StacklessClosedChannelException
[13:57:17 WARN]:    at io.netty.channel.AbstractChannel.close(ChannelPromise)(Unknown Source)
[13:57:17 WARN]: io.netty.channel.StacklessClosedChannelException
[13:57:17 WARN]:    at io.netty.channel.AbstractChannel.close(ChannelPromise)(Unknown Source)
[13:57:17 WARN]: net.minecraft.network.PacketEncoder$PacketTooLargeException: PacketTooLarge - PacketPlayOutAdvancements is 43906883. Max is 8388608
[13:57:17 WARN]:    at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:61)
[13:57:17 WARN]:    at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:14)
[13:57:17 WARN]:    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856)
[13:57:17 WARN]:    at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:851)
[13:57:17 WARN]:    at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1010)
[13:57:17 WARN]:    at io.netty.channel.AbstractChannel.write(AbstractChannel.java:296)
[13:57:17 WARN]:    at net.minecraft.network.Connection.doSendPacket(Connection.java:473)
[13:57:17 WARN]:    at net.minecraft.network.Connection.lambda$sendPacket$10(Connection.java:442)
[13:57:17 WARN]:    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
[13:57:17 WARN]:    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
[13:57:17 WARN]:    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
[13:57:17 WARN]:    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
[13:57:17 WARN]:    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
[13:57:17 WARN]:    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[13:57:17 WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
[13:57:17 INFO]: --- lost connection: Internal Exception: net.minecraft.network.PacketEncoder$PacketTooLargeException: PacketTooLarge - PacketPlayOutAdvancements is 43906883. Max is 8388608
[13:57:17 INFO]: --- left the game

My plugins are: v6.2.0 https://www.spigotmc.org/resources/alwaysonline.66591/ v1.10.34 https://www.spigotmc.org/resources/spark.57242/ v1.2.9 https://www.spigotmc.org/resources/custom-advancements.91167/ 2.0.1 https://www.spigotmc.org/resources/customdeathmessages-cdm.69605/ 1.3.17 https://www.spigotmc.org/resources/tabtps-1-8-8-1-19-4-show-tps-mspt-and-more-in-the-tab-menu.82528/ 2.11.3 https://www.spigotmc.org/resources/placeholderapi.6245/

Server: Paper (Build 32) for (MC: 1.20.1)

Is there a way to bypass the packet limit?

rowan-vr commented 1 year ago

Can you try to decrease these values in the config?

packet:
  advancements-per-packet: 5 # The amount of advancements sent to the player per packet, if your advancements contain
                             # long descriptions set this lower, this may cause some client-side lag when set too low
  progress-per-packet: 5  # The amount of progressions sent per packet to the player, if you wich to use 'COUNT' for
                          # advancements with high amounts (> 100000) set this lower, this may cause some client-side lag when set too low
User4716 commented 1 year ago

I have them 4 and 5 but should I put them to 2? And then reload the plugin or restart server

rowan-vr commented 1 year ago

Also try to change this value: https://github.com/rowan-vr/CustomAdvancements/wiki/Configurations%3A-Advancement-configuration#minecraft-progress-type-since-v124, preferably to PERCENTAGE, you can use PAPI placeholders to display the exact amount in the advancement description

User4716 commented 1 year ago

What should I set the minecraft-progress-type to? Do is set it to none.

And how do I exactly show placeholders in advancements, do I put them into the description or the name or where?

rowan-vr commented 1 year ago

You should set it to PERCENTAGE, check the Walker1 advancement for an example how to use the PAPI placeholders (make sure to have placeholder-api installed)

User4716 commented 1 year ago

I have that, and I set the advancements-per-packet and progress-per-packet both to 2 and still when I join I get timed out after like 30 seconds. Let me try the Placeholder method

rowan-vr commented 1 year ago

Can you send me your advancement trees, on discord DMs if you don't want to share it publicly (@ tippie) I'll look at it then after lunch

User4716 commented 1 year ago

Ok, I could send you one advancement tree soon

But Walker1 looks like this:

  walker1:
    type: blockstravelled
    value: ignored
    amount: 10000
    requirements:
      advancement:
        type: advancement
        value: example.walker
    rewards:
      message:
        type: message
        value: '&6Your feet probably hurt, I will heal you.'
      command:
        type: consolecommand
        value: heal %player%
    display:
      name: Walker I
      item: CHAINMAIL_BOOTS
      gui_location: auto
      unit: blocks walked

What do you mean this is an example for PAPI? Do you mean the %player% part

rowan-vr commented 1 year ago

I meant walker oops:

      description: "Walk a lot!\n - %customadvancements_progress_percentage_example.walker%% Completed!"
User4716 commented 1 year ago

Is there a list where I can find all the placeholders that this plugin adds? Or is that the only one?

And here is the file that is needed to break the server (It's a Txt file because GitHub doesn't support yml, Convert it to yml) advancements.txt

Am I doing something wrong, the advancement page doesn't even show up in the Minecraft advancement GUI

rowan-vr commented 1 year ago

https://github.com/rowan-vr/CustomAdvancements/wiki/Placeholders

User4716 commented 1 year ago

I noticed some minor things in that text file I sent here that could cause bugs. I fixed them, and here's the updated file advancements.txt

Edit: still doesn't work

User4716 commented 1 year ago

⚠️ I think I wound the issue.. probably

  7:
    type: impossible
    value: 
    amount: 5000000
    rewards:
      message:
        type: message
        value: ''
      command:
        type: consolecommand
        value: a
    display:
      name: a
      item: ELYTRA
      item-data:
         glowing: true
      description: a
      gui_location: 'auto'
      guiLocation: auto
      unit: a
      minecraft-gui-frame: "CHALLENGE"
      minecraft-toast: true
      minecraft-chat-announce: true
      minecraft-progress-type: "COUNT"

The value is 5 million and that doesn't seem to be working

User4716 commented 1 year ago

It is it. I reduced every advancement with a value greater than 1 million to under 1 million and EVERYTHING seems to be working just fine so far!

rowan-vr commented 1 year ago

Change, "COUNT" to "PERCENTAGE", that should fix it

User4716 commented 1 year ago

YEah but it is already fixed

User4716 commented 1 year ago

I did this

It is it. I reduced any advancement with a value greater than 1 million to under 1 million and EVERYTHING seems to be working just fine so far!

rowan-vr commented 1 year ago

Just reducing the value isn't really a solution if you do want an advancement where you have to walk 5 mil blocks for example

User4716 commented 1 year ago

Yeah but the advancemets that had values over 1 million were elytra fly distances, and the statistic for that didn't work anyways.. So I set the type to impossible, and now players need to show me screenshots of their statistics for me to grant them the advancement

User4716 commented 1 year ago

The server where I had the errors was my local testing server, which was the server where I make the advancements, now I've imported all of the advancements to my actual SMP that runs on Aternos. And now I have the same issue again, (on the Aternos server) I get timed out after a few seconds.

I reduced these values to 3, hopefully that helped something image

And I also set all of my advancements that had values around 3000-7000 to be PERCENTAGE so that the server doesn't need to be sending thousands of packets, there are still around 10 advancements that are 800-2000

And still, I have this kick message after around 10 seconds.

Sometimes I can play for 3-10 seconds and then everything freezes. It might unfreeze after many seconds and then freeze again, I don't know if this is a network issue or what.

And I get this kick message also sometimes. image

I don't have any errors in the console. It might also be because in that Aternos server, I have around 60 plugins.

I tried it again on my testing server and it seems to be working

User4716 commented 1 year ago

Update: I removed every single advancement tree and the advancement data, and I still have the issue, so it seems like the problem is caused by one of my plugins, but the hard part is which one of the plugins is causing it.. 🫤

Update: I removed the whole CustomAdvancements plugin and still now working, I am in the process of figuring out which plugin is causing the bug. I'll update here when I found the plugin.

Update: The problem is on every server I join, so it is an issue with my internet connection or antivirus