mojira.dev
MC-17222

ALL Spawners with ActiveEffects crash the game, breaking hundreds of custom maps and servers.

Before you close this as the 20th duplicate of MC-16191, please read below.

Almost two dozen people have reported this problem, and JIRA moderators have closed every report as a "Duplicate" of a certain non-descriptive report, MC-16191, which is itself closed as "Invalid". This is essentially the same as closing all of these reports as Invalid - when they describe a very real bug.

Prior to 13w21a, if you had this crash report, the only possible cause was Invalid: it could only be caused by attempting to spawn an entity with a potion effect that has an invalid ID. This is why Dinnerbone closed MC-16191.

However, since 13w21a, this crash has occurred on all spawners with potion effects, including those with valid IDs. This is due to a bug in deserializing potion effects: the game makes the assumption that an entity's Attribute Map has been fully initialized when it tries loading its potion effects. This is because certain Potion Effects now interact with the Attributes system. Because the game makes no attempt to actually initialize the entity's Attributes before loading its potion effects, it gets a NullPointerException due to the missing Attributes. There is no workaround for this issue.

You can observe the bug yourself, with the following steps:

  1. Load the attached test world in 13w19a or earlier.

  2. Observe that there is no crash. It works perfectly fine!

  3. Load the attached world in 13w21a or later - this is the version the bug was introduced.

  4. Observe that the game crashes, despite it working fine in previous versions.

I have been speaking to several mapmakers who have been complaining about this bug. This is not an isolated incident, and it is not invalid. It is a map-making feature which worked correctly prior to 13w21a, and was used extensively by countless mapmakers, including high-profile ones such as Hypixel and Vechs. It was broken three snapshots ago, and Dinnerbone has not indicated being aware of its existence. This is why we have a bug tracker: so bugs can be reported to Mojang and fixed. By closing every instance of a bug like this, there is no reason to expect that Mojang will ever come to fix it.

In case I have not made it clear: When Dinnerbone closed MC-16191, he closed it as "Invalid" because, according to him, the poster had created a spawner with a non-vanilla potion ID. Now, I don't know whether that was actually the case, but I can tell you for a fact that it is not the case with the attached test world. The attached test world should not crash on any version of Minecraft ever since this feature was added. The fact that it crashes in the three latest snapshots is a bug. Dinnerbone and Mojang have never acknowledged this crash as intentional.

Please, all I ask of you, is that if/when you come to close this report as a "duplicate" of MC-16191, please, re-open MC-16191. If you're going to close almost two dozen valid reports as duplicates of MC-16191, then MC-16191 should no longer be considered "invalid". Regardless of the status of the original poster's world, the other reporters here are experiencing a valid, world-corrupting bug, and there is no reason to go to such lengths to ensure Mojang never even sees our reports.

Linked issues

Attachments

Comments 9

I am only able to get MC-16290 to happen in my test world.

In my attached test world, it's a zombie with Fire Resistance. However, it's happened for zombies with Invisibility, Strength, and other effects as well.

I've attached a schematic if you want to take a closer look.

EDIT: You only get MC-16290, even on my attached test world? Other users have gotten a NullPointerException (as the attached crash report shows) for it. What version are you running, and have you added/modified any other spawners in the world?

I noticed you were missing the "Leashed" tag, but it didn't make a difference.

Appears to have something to do with the presence of SpawnPotentials causing the crash, but I couldn't manage to get my own to work. Removing SpawnPotentials didn't fix your world.

Like many tags, Leashed isn't required in spawners because SpawnData/Properties are actually applied to a mob after it is created and added to the world, and Leashed is initialized to 0 by default.

For clarification however, my test world gives you a java.lang.UnsupportedOperationException, rather than java.lang.NullPointerException? From what I can tell, there's actually no reason for that to even be possible - the spawner in my test world has no Attributes tag, and the game explicitly checks for its presence before attempting to load Attributes. If the Attributes tag does not exist, it makes no attempt to modify any Attributes, read-only or otherwise. The MC-16290 crash doesn't happen for me unless I give the SpawnData Attributes - which are optional, as I said.

As for "fixing" my world, you have to remove "ActiveEffects" from both SpawnData and SpawnPotentials. SpawnData is the next mob to be spawned, and because you left it intact, the game still tried processing ActiveEffects. Removing ActiveEffects altogether should "fix" the world, but the zombies will no longer spawn with Fire Resistance on any version.

EDIT: As a reminder, if you try my test world on 13w19a or earlier, there will not be any crash, and the zombies will spawn with Fire Resistance. Removing ActiveEffects will stop the crash on later versions, but also remove the potion effects on earlier versions, meaning this "workaround" isn't actually a workaround at all - it would still break any adventure map which relies on any sort of status effects spawned on mobs.

I can reproduce the crash in your test world, but not in mine. Mine returns MC-16290.

Daniel "Glampkoo"

How is this a community consensus? This should be confirmed!

That's odd. Is it possible that your test world has another spawner in it, unrelated to mine? If so, the crash could be caused by that spawner instead.

If you created a spawner using a filter on a zombie in any version beyond 13w_16_a, it will automatically have an Attributes tag, which is what causes MC-16290. In this case, this world would get MC-16290's crash on any version beyond 13w21a, which (as far as I remember from looking at the code) is the version which added the concept of read-only Attributes.

If you create your mob-with-status-effect spawner using a filter on a mob in a version such as 1.5.2, and then attempt to load the world on 13w21a+, you should be getting the crash seen here.

From what I can tell:
13w16a - the version which first added Attributes. Mobs in this version or higher will have Attributes tags.
13w19a - the last version in which spawners with "Attributes" or "ActiveEffects" tags do not crash the game.
13w21a - the version which added the concept of read-only Attributes (causing MC-16290, as spawners first create the mob and subsequently attempt to modify its Attribute tree, which contains some (or perhaps only) read-only Attributes, if the "Attributes" tag exists. Essentially, this bug is caused because spawners are not allowed to modify an existing entity's Attributes, and said entity will always exist before it attempts to attach the Attributes to it). In this version, Status Effects have also gained a dependency on the Attributes system (causing this crash, because apparently when loading SpawnData into an existing mob, the spawner seems to create a 'virtual entity' without Attributes (as SpawnData with Attributes causes an unrelated crash), assumes those Attributes exist anyhow, and then tries to dereference said nonexistent Attribute data in order to apply ActiveEffects. This bug is separate from the other one, and is caused by a quirk in trying to load ActiveEffects).

EDIT: So, I've misunderstood the cause of MC-16290, as Dinnerbone pointed out - the issue is that spawners are currently attempting to register modifiers (which already exist?), when it shouldn't do that. Chances are I've misunderstood the immediate cause of this crash, too, apart from the general "spawner defines ActiveEffects and not Attributes". Sorry for jumping to conclusions; I'm still a noob to exactly how the Attribute/Modifier registry system works.

Confirmed.

Spawners that utilise ActiveEffects crash in the weeklies. The same spawners work fine in 1.5. ActiveEffect tags are valid.

WolfieMario

Nathan Adams

Confirmed

corrupt, crash, potion, potion-effect, spawner

Snapshot 13w21b, Snapshot 13w22a

Snapshot 13w23b

Retrieved