PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.75k stars 2.28k forks source link

New Lag / Chunk Ban Exploit with Sand #5521

Closed blockswerker closed 3 years ago

blockswerker commented 3 years ago

Timings or Profile link

https://timings.aikar.co/?id=a36ba223b88041ed8328698daa6ddc82

Description of issue

This is a copy and paste of a reddit thread I started. I'm mentioning it here because some thought I should.

I have tested this on Paper 1.15.2 and 1.16.5.

I run an anarchy server (can I say the name? It's sweetanarchy.net) and my players have been experimenting with Block 36 (minecraft:moving_piston). They have discovered that sand becomes a falling_block entity when it passes into B36 and stays that way. My players made this video showcasing it in creative mode (I removed this link because I just realized the owner set it to private). It's easy to replicate.

This effects older clients and players with normal graphics cards the most and will result in a kind "chunk ban" where the player can't move or type effectively, or may even crash their client. However, the server is not immune because falling_blocks are entities, not blocks and it will create server lag (TPS drop) when someone enters a chunk with thousands of these entities. The most I've measured is 5500 falling_block entities in a single chunk. Several players loading and unloading multiple chunks can be very bad.

The amount of space and resources required for this exploit is really small, so you might not even realize someone has built it.

The usual plugin I'd go to is AnarchyExploitFixes. That plugin only effects sand that becomes a falling block, it does NOT effect sand that is already a falling block. The developer of that plugin says he is going to address this.

I am trying to move away from LagAssist but I reached out to the developer of that plugin and he told me that I can use his plugin's chunk cleaner (runs every 6000 ticks by default) to cull falling_block entities to a value of my choosing (I chose 20). Right now this is the only solution I know of short of disabling gravity blocks entirely.

Helpful edit: You can "kill" these entities in loaded chunks with: /minecraft:kill e@[type=falling_block] but that won't prevent it from happening again.

Plugin list

AnarchyExploitFixes, AntiChunkBan, AntiFlint, AntiIllegalItems, AntiNetherRoof, BotSentry, cbook-patch, ClearLag, CoreProtect, DeathMessagesPrime, DisableJoinMessage, DisableWither, Essentials, ExploitFixer, FixHackedItems, Green, HamsterAPI, IDD, IllegalStack, LagAssist, LuckPerms, NoCheatPlus, NoPhantoms, OpenInv, PandaWire, PistonMOTD, PlugMan, ProtocolLib, Skript, SpeedLimit, TAB, Vault, VaultChatFormatter, ViaBackwards, ViaVersion, WorldEdit

Server config files

This is the main configuration file for Paper.

As you can see, there's tons to configure. Some options may impact gameplay, so use

with caution, and make sure you know what each option does before configuring.

If you need help with the configuration or have any questions related to Paper,

join us in our Discord or IRC channel.

Discord: https://paperdiscord.emc.gs

IRC: #paper @ irc.spi.gt ( http://irc.spi.gt/iris/?channels=paper )

Website: https://papermc.io/

Docs: https://paper.readthedocs.org/

verbose: false allow-perm-block-break-exploits: false config-version: 20 settings: max-joins-per-tick: 3 load-permissions-yml-before-plugins: true bungee-online-mode: true console-has-all-permissions: false suggest-player-names-when-null-tab-completions: true save-player-data: true region-file-cache-size: 256 incoming-packet-spam-threshold: 300 use-alternative-luck-formula: false enable-player-collisions: true chunk-tasks-per-tick: 1000 save-empty-scoreboard-teams: false velocity-support: enabled: false online-mode: false secret: '' watchdog: early-warning-every: 5000 early-warning-delay: 10000 spam-limiter: tab-spam-increment: 1 tab-spam-limit: 500 book-size: page-max: 2560 total-multiplier: 0.98 async-chunks: enable: true threads: -1 unsupported-settings: allow-piston-duplication: true messages: no-permission: '&cI''m sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.' kick: flying-player: Please dont try to fly on Sweet Anarchy lol flying-vehicle: Please dont try to fly on Sweet Anarchy lol authentication-servers-down: '' connection-throttle: Connection throttled! Please wait before reconnecting. timings: enabled: true verbose: true server-name-privacy: false hidden-config-entries:

Paper version

Paper version git-Paper-387 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)

Agreements

electronicboy commented 3 years ago

paper.yml already has the means to limit the number of entities which can be saved/loaded in a chunk to address this type of stuff, there is very little we can do about mechanics which allow people to create tons of entities without just straight up breaking behaviors of stuff in the game, unless there was a clear win here, which there isn't, there is very little we can do overall to resolve these types of issues which typical entity limiting can't already solve in a much cleaner way, even if caveated