There are special versions of Spawners that utilize the spawn-once feature of mismatched SpawnData and SpawnPotentials tags. The SpawnData uses proper coordinates, and the SpawnPotentials uses void coordinates. Control of these spawners is done using spawner carts and lava. I have discovered an instance where a base spawner responsible for spawning spawner carts is creating a massive number of phantom item entities when they are stacked. I think these item entities are being created for display on a spawner cart, but end up at the spawner cart's spawn location (not the actual location of the spawner cart). Since these tags are deeply nested in two ways, it is difficult to explain. Attached is an MCEdit schematic of a spawner that reproduces this problem. The stacked items it is spawning are indeed an extreme example, but I've had similar problems with a reduced number of stacked items. Single items spawned using this system of spawners/cart spawners do not exhibit this behavior.
Linked issues
Attachments
Comments 24
Alright I did a bit of testing with this. Basically a spawner spawning a stacked item entity spawner is bugged.
Here's what it does:
-Spawner1 is spawning Spawner2.
-Spawner2 is spawning an Item Entity that's riding an Item Entity at X
-Every time Spawner1 tries to spawn Spawner2, Spawner1 ALSO uses the "Riding" data that's in Spawner2, and spawns a phantom item at X
None of the SpawnData/SpawnPotentials stuff has to do with it.
Able to reproduce in 13w19a with the file you attached.
However, your schematic has some severe malformatting. It seems inconsequential here, but your last item has an empty riding tag, and your first item has tags which belong to a FallingSand.
More importantly, you're making the critical mistake of setting the Pos tag of the highest entity in a stack. In the NBT format, when an entity has a "Riding" tag, it is riding on top of another entity. In the game, it is illegal for an entity to assume its own position when it is riding on another entity - this is why endermen cannot teleport out of minecarts. The phantom bug occurs because the game is attempting to set the Pos of the top entity, when the actual position is determined by the bottom entity. This bug could perhaps remain open as phantoms should not be generated in any case, malformatted NBT or not, but it has no bearing on a map maker's ability to spawn stacked entities.
I have attached a schematic with correct formatting - you'll notice that the Pos tag is in the bottom-most entity, which also has no Riding tag. I am unable to reproduce the bug with this setup - please correct me if I'm wrong, but from what I can see it behaves exactly as it should.
That is arguably somewhat incorrect. All of the riding entities will be populated with position tags upon loading by Minecraft, but only the top-most entity's position tag exists in the base root of the entity. This is the entity that is serialized to disk upon world saving, and all of the other entities are merely appendages of it. You are correct that Minecraft will correctly populate the position fields when the base riding entity's position is set, however. This is a good work-around that I will implement in my filters. It should be noted that the base spawner was creating the phantom entities, and not the minecart spawner that is supposed to spawn it. The base spawner should not even attempt to spawn the stacked entities.
I find it incredibly strange that the base spawner would even attempt to spawn items at all - clientside or otherwise - when it's merely meant to spawn a spawnercart which spawns said items. How does one even go about testing that?
As for why it's incorrect to specify Pos in the top entity of a stack when dealing with spawners, you have to consider that spawners do not actually spawn the entity in with all the tags we specify in SpawnData/Properties. Instead, the entity is spawned as a default entity, and the properties are subsequently applied. There's no guarantee that the Pos property is applied before the Riding property. The sequence of events spawning a stack of entities with Pos tags may well be the following:
Spawn ItemA at default coordinates randomly chosen by Spawner.
Apply Pos tag to ItemA, moving it to these coordinates.
ItemA is riding ItemB, so spawn ItemB at default coordinates randomly chosen by Spawner.
Attach ItemA to ItemB, updating its position. ItemA's true position is now on top of ItemB and not where Pos specified.
The alternative:
Spawn ItemA at default coordinates randomly chosen by Spawner.
ItemA is riding ItemB, so spawn ItemB at default coordinates randomly chosen by Spawner.
Attach ItemA to ItemB, updating its position.
Apply Pos tag to ItemA, moving it to these coordinates. The server will consider this an invalid movement, as ItemA is riding ItemB and should not move independently of it.
Unfortunately, what may work for entities serialized in the world doesn't necessarily work for entities created by a spawner - I'd imagine that although it's correct for the top entity to have Pos during serialization, as the game is programmed to handle this formatting correctly at deserialization time, the same does not necessarily apply when entities are created by spawners. If so, it would be nice if Mojang could change the behavior to be more consistent, and you're right in saying the current phantom behavior remains a bug.
One thing I don't want them to do, of course, is to change the current behavior of "apply properties after spawning", as this would prevent mapmakers from doing things such as having a spawner in a dark room create a capped number of monsters in a light room.
Adam made this video. But I didn't want to use this because you can still trade with villagers. The overloading RAM wasn't really a problem, because I set the spawnradius to 0 so they would only spawn once. I guess I'll give your way a try. I don't think trading with villagers is such a problem. The despawning and setting the game to peacefull is a bigger problem, but I think I can use spawners to create them.
Well, if you don't want your ghosts to despawn when the player wanders far, make sure you set PersistenceRequired to 1. It won't stop Peaceful from deleting Hostiles, however.
As for trading with villagers, you could edit their available trade offers - I personally use some offer slots to communicate with the player, by creating an offer which is fully expired (red X on the trading arrow), where the villager's dialogue is on a renamed/loretext'd sign in the output slot, and the player's dialogue is on a similar sign in the input slot. If either participant has no dialogue, I instead make their item a Cauldron (Block ID, not Item ID), which just looks like an empty black square, similar to an empty item slot.
Also, since you're using real entities, you could also have custom names over their heads if you wanted.
Ah, yes PersistenceRequired. I've heard of that. I knew about the custom trades, but the trading is not a big deal. The player doesn't have items in my map anyway. It's just that I don't like the possibility to trade.
The biggest problem I'm having now is that there isn't a way of creating these entities like Adam did using the NBTedit mod (as far as I know) I'm using, so I'm going to have to use mcedit or an NBTeditor wich is a pain in the *** if you ask me.
Please move your conversation to someplace designed for map making discussions. Perhaps http://www.reddit.com/r/Minecraftmapmakers/ ; this site is for bug tracking.
I forgot to note that the spawn coordinates for the items are -95.5, 4.5, 581.5.