You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The maximum speed of placing blocks with the main hand and the off hand should be the same
Observed/Actual behavior
It is easier to make blocks become "ghost blocks" when quickly placing blocks through an off hand. The main reason for blocks to become "ghost blocks" is that packets are sent up to the limit set by paper.
In ServerGamePacketListenerImpl code, can be noticed that:
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;
private static int getSpamThreshold() { return io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; } // Paper - Configurable threshold
private boolean checkLimit(long timestamp) {
if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < getSpamThreshold() && this.limitedPackets++ >= 8) { // Paper - Configurable threshold; raise packet limit to 8
return false;
}
if (this.lastLimitedPacket == -1 || timestamp - this.lastLimitedPacket >= getSpamThreshold()) { // Paper - Configurable threshold
this.lastLimitedPacket = timestamp;
this.limitedPackets = 0;
return true;
}
return true;
}
// Spigot end
After testing, it was found that when the blocks are placed with off hand, the client sends packets to the server twice at the same time. The two sending packets are the main hand interaction and the off hand interaction. This brings the time line between packets directly to the set spam threshold.
Therefore, the repair method is very simple. It might be possible to check whether the two packets are sent separately for the main hand and off hand.
Steps/models to reproduce
Fast placing blocks with main hand and off hand, observe the difference. You can test this with an auto clicker and set the click per second to 10.
Plugin and Datapack List
pl
[04:52:10 INFO]: Server Plugins (5):
[04:52:10 INFO]: Bukkit Plugins:
[04:52:10 INFO]: - LuckPerms, packetevents, PlaceholderAPI, ViaBackwards, ViaVersion
datapack list
[04:52:14 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[04:52:14 INFO]: There are no more data packs available
Paper version
This server is running Paper version 1.21.4-128-main@7e21cb8 (2025-01-26T22:08:28Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-DEV-b48403b (MC: 1.21.1)
Other
No response
The text was updated successfully, but these errors were encountered:
Expected behavior
The maximum speed of placing blocks with the main hand and the off hand should be the same
Observed/Actual behavior
It is easier to make blocks become "ghost blocks" when quickly placing blocks through an off hand. The main reason for blocks to become "ghost blocks" is that packets are sent up to the limit set by paper.
In ServerGamePacketListenerImpl code, can be noticed that:
After testing, it was found that when the blocks are placed with off hand, the client sends packets to the server twice at the same time. The two sending packets are the main hand interaction and the off hand interaction. This brings the time line between packets directly to the set spam threshold.
Therefore, the repair method is very simple. It might be possible to check whether the two packets are sent separately for the main hand and off hand.
Steps/models to reproduce
Fast placing blocks with main hand and off hand, observe the difference. You can test this with an auto clicker and set the click per second to 10.
Plugin and Datapack List
Paper version
This server is running Paper version 1.21.4-128-main@7e21cb8 (2025-01-26T22:08:28Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-DEV-b48403b (MC: 1.21.1)
Other
No response
The text was updated successfully, but these errors were encountered: