mojira.dev
MCPE-172242

Adding and removing thousands of unique tags to an entity causes server to force shutdown

If you add a unique tag to an entity (a tag that has not been added to it before such as a random string of characters) and remove the tag from the previous tick every tick, the game will have progressively longer lag spikes and will eventually force the server to shutdown. This does not affect TPS generally.

To replicate, have this JavaScript run in the entry point file of the scripting API (an easy way to generate unique tags):

import {world, system} from '@minecraft/server';
system.runInterval(() => {
    const players = world.getDimension("overworld").getPlayers();
    if (players.length == 0) return;
    const player = players[0];
    for (const tag of player.getTags()) player.removeTag(tag);
    player.addTag(`tag_${Math.random()}`);
});

With this running, the lag spikes began around 10-15 minutes into the test. Watchdog alerts will signal the lag spikes.

Despite there only ever being one tag on the player at a time, the game appears to have a build-up of them until it just stops working altogether. From my testing, it seems combinations of multiple tags cause the same issue, even if there aren't thousands of unique tags, thousands of unique combinations cause similar lag spikes.

Comments 1

Thank you for your report!
However, this issue has been temporarily resolved as Awaiting Response

Is this still an issue in the latest version?

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Dominexis

(Unassigned)

1062166

Confirmed

Windows

Windows 10

1.20.1 Hotfix

Retrieved