Please, do not close this issue as a duplicate of an Invalid or Duplicate report!
I've seen many people try to report this bug, always to have it closed as a duplicate of MC-16257 or a duplicate of a duplicate of MC-16257. The outcome is the same: a valid ticket is closed as a duplicate of an "invalid" one, hindering chances of this bug ever being fixed. Either re-open MC-16257, or do not close this as a duplicate, please. What follows is some pretty solid evidence that this bug is not Invalid.
What I expected to happen:
Horse spawners would work in the game whether or not SpawnData/SpawnPotentials are present.
What actually happened:
The game crashed in response to a horse spawner if and only if it had SpawnData or SpawnPotentials. This renders it impossible to create a custom horse spawner in vanilla Minecraft.
Why this is not Invalid:
Contrary to Dinnerbone's claim, this crash does not only happen due to invalid entity IDs. A spawner with the EntityID "EntityHorse" will not cause a crash, unless it also includes SpawnData or SpawnPotentials. This behavior is unique to EntityHorse; no other entity causes crashes if and only if a spawner attempts to customize its properties.
Steps to Reproduce:
- Import the attached "Good Random Horse" schematic into your world.
- Observe that it spawns horses, but they are random. Also observe that no horse is spinning in the spawner cage.
- Import the attached "Bad Horse" schematic into your world.
- Observe that it, too, does not crash the game...
- Wait until it spawns a horse, and observe that your game has crashed! Not consistent or logical behavior at all, is it?
Semi-viable Workaround:
- Import the attached "Forced Good Custom Horse" schematic into your world. This schematic makes use of entity riding to hide the horse from the player until it has already been spawned, narrowly avoiding the crash (the developer console still gets spammed with stacktraces however - more on that below).
- Observe that it spawns white horses every time.
- More importantly, observe that it does not stop spawning horses regardless of how many are nearby. It also allows horses to spawn underwater, in darkness, or even inside solid blocks. The workaround may avoid causing the crash, but I certainly wouldn't call this a permanent solution!
- Note that the spawner's odd behavior is actually intended: the rider of the horses is a quickly-despawning XPOrb. Thus, the spawner's entity cap and spawn condition rules follow those of XPOrbs. Please don't change this behavior; many spawner setups make use of the "topmost entity defines spawning conditions" behavior and would break if it were changed (the behavior allows mapmakers to customize spawning conditions to suit their needs). The "Forced Good Custom Horse" schematic doesn't need any fixing - "Bad Horse" does!
The Cause:
I'm not sure why this would happen, but check out "Console Spam InvocationTargetException.txt" - it's an incredibly long stacktrace which occurs prior to the crash. It's not part of the crash report, so I don't think anyone's reported it yet. It's produced by EntityList.createEntityByName (MCP name) when trying to render any horse spawner (any of the three attached schematics): this is why the entity is null by the time the game hits line 110 of the spawner logic class, causing the crash. This is also what differentiates this from your average "unknown entity ID" crash - the ID is not unknown, but I have no idea why the reflection calls fail.
EDIT: I have found the cause; I've posted in-detail below. To sum it up briefly, horses don't accept instantiation with a null world, which happens to be a requirement for mobs to not cause crashes with SpawnData spawners.
- is duplicated by
-
MC-16257 Creative world crashed after being opened in new snapshot (13w21a).
- Resolved
-
MC-16461 Monster Spawner Crash
- Resolved
-
MC-16609 I had a redstone-toggled spawner in my map to spawn horses in 13w19a and when I went to 13w21a, my game crashed.
- Resolved
-
MC-16844 Approaching a skeleton horse spawner crashes the game (Zombie horse hasn't been tested)
- Resolved
-
MC-19177 Crash upon loading world
- Resolved
-
MC-19791 Horse Spawners with SpawnPotentials or SpawnData Crash Minecraft
- Resolved
-
MC-20096 I used SethBlings ChangeSpawnerProperties to change properties on a Horse spawner and got this 2 times.
- Resolved
-
MC-21331 Horse spawners crash with properly configured SpawnData.
- Resolved
-
MC-24385 my world won't open any longer. When I log in it says my world has crashed
- Resolved
-
MC-27291 Horse spawner crashes the game
- Resolved
-
MC-27558 Simple Modified Spawners Crash game immediately
- Resolved
-
MC-28683 Hopper: java.lang.NullPointerException (SourceFile:110)
- Resolved
-
MC-31349 horse spawner crashes minecraft
- Resolved
-
MC-37305 Hopper: java.lang.NullPointerException: Rendering Block Entity
- Resolved
-
MC-38876 Error when Summoning Custom Villager/Spawner
- Resolved
-
MC-43592 I tried spawning something with a command block
- Resolved
-
MC-50173 Minecraft setblock issues
- Resolved