[MC-1530] Entity Spawners spawn items and other entities inside blocks Created: 31/Oct/12  Updated: 16/Feb/20  Resolved: 16/Feb/20

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.4.6, Snapshot 13w09c, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.8.9, Minecraft 16w05b, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1
Fix Version/s: None

Type: Bug
Reporter: Hegymegi K. Áron Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 12
Labels: entities, item, spawner

CHK:
Confirmation Status: Confirmed
Category:
Entities, Mob spawning

 Description   

unlike mobs, other entities don't seem to have any limitation to where they can spawn using a modified monster spawner. so if i have a spawner underground that spawns swords, the swords will appear inside the blocks near the spawner.
this is a problem because this means that these spawners can't be shut down, like regular mob spawners.
this is more of a suggestion, but i think non-mob entities should have a 1x1 block spawning requirement, so that these spawners can be turned off using a piston.



 Comments   
Comment by [Mod] Michael Wobst [ 16/Feb/20 ]

Tickets that haven't been reproduced quite some time ago get resolved as CR by us.

Comment by Fabian Röling [ 16/Feb/20 ]

Then it's "fixed" and not CR.

Comment by [Mod] redstonehelper [ 16/Feb/20 ]

Unable to reproduce with items as of 20w07a.

Comment by Fabian Röling [ 22/Jun/16 ]

Confirmed for 1.10.1.

Comment by Fabian Röling [ 12/Jun/16 ]

Confirmed for 1.10.

Comment by SunCat [ 27/Apr/16 ]

Still in 1.9.3-pre2

Comment by SunCat [ 12/Mar/16 ]

Still in 1.9.1-pre3

Comment by SunCat [ 09/Mar/16 ]

Still in 1.9.1-pre1

Comment by SunCat [ 27/Feb/16 ]

Still in 1.9-pre4

Comment by SunCat [ 24/Feb/16 ]

Still in 1.9-pre3

Comment by [Mod] redstonehelper [ 19/Feb/16 ]

How can you confirm this bug while MC-97491 is in effect?

Comment by SunCat [ 05/Feb/16 ]

Still in 16w05b
For further tests:

/setblock ~ ~ ~ minecraft:mob_spawner 0 replace {SpawnData:{id:ArmorStand,NoGravity:1}}
Comment by Galaxy_2Alex [ 30/Oct/14 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.

Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been deliviered.

Comment by Anon Ymus [ 12/Jul/13 ]

Confirmed in 1.6.2.

Comment by Markku [ 03/Mar/13 ]

Potential fix
.. or at least a start for one..

Add the method getCanSpawnHere() all the way into Entity-class. Thus the EntityLiving merely overrides it. The default implementation would then handle any non-living entity. Effect entities need to be able to spawn about anywhere, so EntityFX would override it, too. Note that currently no other piece of code than the spawner would call those methods.

Entity
    /**
     * By default, entities can not spawn inside blocks that block movement. This is a bit
     * crude check, but then again, it is just the default base implementation.
     */
    public boolean getCanSpawnHere() {
        int x = (int) Math.floor(this.posX);
        int y = (int) Math.floor(this.posY);
        int z = (int) Math.floor(this.posZ);
        int blockId = this.worldObj.getBlockId(x, y, z);
        if (Block.blocksList[blockId].getBlocksMovement(worldObj, x, y, z))
            return false;
        return true;
    }
EntityFX
    /**
     * By default, all effect entities can spawn anywhere.
     */
    public boolean getCanSpawnHere() {
        return true;
    }
TileEntityMonsterSpawner.updateEntity()
            ...
            //if (var11 == null || var11.getCanSpawnHere()) {
            if (tobeSpawnedEntity.getCanSpawnHere()) {  // FIX: Simply let the entity decide in all cases
                this.writeNBTTagsTo(tobeSpawnedEntity);
                this.worldObj.spawnEntityInWorld(tobeSpawnedEntity);
                this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0);
                ...

NOT TESTED. I only checked on 1.4.7 that at least pig-spawner still spawned the pigs. (That is, it did not break spawning living entities). Did not check what it would do to spawning non-living entities.

Comment by Novi Bliss [ 12/Feb/13 ]

Custom spawners are, in fact, a feature of the game, and should be properly implemented now that their capabilities have been expanded in vanilla. This update has been almost entirely dedicated to giving map makers much broader tools to work with – it seems like this is quite an issue for anyone who wants to have randomized loot drops in their maps!

Comment by Adithya Subbiah [ 27/Dec/12 ]

Wait you can spawn entities in I had no clue u could do this how can u do this please tell me

Comment by NightKev [ 25/Dec/12 ]

http://www.minecraftwiki.net/wiki/Version_history#1.3.1
"Monster Spawners

  • Added NBT tags to further customize spawned mobs.
  • Only changeable using map editors or mods."

http://www.minecraftwiki.net/wiki/Version_history#1.4.2
"Mob Spawners

  • Added a few NBT tags to change a few key spawning rules
  • Range can now be changed
  • Maximum amount of spawned entities within spawning range can now be changed
  • Horizontal spawning radius can now be changed
  • Spawned mobs can wear and carry any items and blocks as well as have a custom drop rate of held items
  • Added an NBT tag for mobs to decide whether they can despawn
  • Added an NBT tag for mobs to decide whether they are invincible"

If you're going to be pedantic and say "oh well it requires using external tools or mods to edit the NBT data thus it's irrelevant to vanilla minecraft", then why did they bother to even do this? Mojang aren't the ones using these added NBT tags, map makers are, and that's who they did it for. This is a feature of vanilla Minecraft that Mojang added, and if there are bugs in it they should fix them.

Edit: remove bullet point where it shouldn't be

Comment by CrusaderDeleters [ 25/Dec/12 ]

Alright. Stop insulting people indirectly.
I'm pretty sure adding a sword entity to the game is NOT a feature of the game. If it is, where can I find it without mods / third party editors?

Comment by NightKev [ 25/Dec/12 ]

Mojang added the ability to make extremely customized spawners intentionally for map makers in 1.3+, this is a FEATURE OF THE GAME that is BUGGED. If you don't even know half the features of the vanilla game you shouldn't be telling people what is and isn't a vanilla feature on this issue tracker.

Comment by Hegymegi K. Áron [ 24/Dec/12 ]

those are nice thoughts. the problem is, that spawners didn't always support non-mob entities. this was a new feature somewhere around 1.3.

Comment by CrusaderDeleters [ 24/Dec/12 ]

It was designed spawn any entities, because it's faster than making new blocks to allow to spawn a Zombie, then a Skellie, then a Spider, then a cave spider, etc. This works for Mob Eggs too, you can "spawn swords", but the swords disappear before you see them. It's easier to make one egg, that can spawn any of the current entity list, than to make 20 eggs individually. Same with the Spawners. Better to make one Spawner, that can spawn any of the current entity list, than to make ~6 spawners individually.

Comment by Hegymegi K. Áron [ 24/Dec/12 ]

Tell me. If they weren't intended to be implemented, then why were they implemented?

Comment by CrusaderDeleters [ 24/Dec/12 ]

These entities you are trying to add (Like swords) were never intended to be implemented into the game, so mojang never needed to add boundaries for these to be spawned.

Comment by Hegymegi K. Áron [ 24/Dec/12 ]

No. I am indeed using a tool to tell the spawners what to do, but the only thing that tool does is opening and editing the game files. This is a feature of the game, you can use maps with these modifications on every client. Also, this isn't tricking the game, this was only added recently for people to use.

Comment by CrusaderDeleters [ 24/Dec/12 ]

He's using a mod to make the other entities spawn.
The mod that alters the Spawners to be configured and spawn those entities should make the requirements themselves. Mojang shouldn't take their jolly own time to patch something for mods, when the mods should do so themselves.

Comment by NightKev [ 24/Dec/12 ]

It's not a mod, it's vanilla Minecraft behavior...

Comment by CrusaderDeleters [ 15/Dec/12 ]

I think that the actual Mod you are using should be making the spawn requirements.

Comment by [Mod] Ezekiel (ezfe) [ 01/Nov/12 ]

Ahh gotcha

Comment by Hegymegi K. Áron [ 01/Nov/12 ]

yes, i know item drops have no spawning requirements, because they couldn't spawn before. but now they can, using custom spawners. so i see this as an issue - if the game has an option to spawn in a sort of entities, it shouldn't spawn them inside solid blocks, because that is not correct behavior.

Comment by [Mod] Ezekiel (ezfe) [ 01/Nov/12 ]

To shut down a spawner you need to make it so that the conditions for that entity to spawn are not met. In the case of a creeper, thats a solid block with light level 7<. An item drop has no such requirements.

Comment by Cat [ 01/Nov/12 ]

Possibly fixed along with MC-15?

If not, related to the spawning-in-sign thing I described over there.

Generated at Sun Jan 12 11:54:45 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.