[MC-8293] Dispensers spawn mobs without offset along the y-axis Created: 25/Jan/13  Updated: 04/Jun/18  Resolved: 09/Aug/16

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Snapshot 13w04a, Snapshot 13w05b, Snapshot 13w06a, Snapshot 13w07a, Snapshot 13w10b, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18c, Snapshot 13w19a, Snapshot 13w24a, Snapshot 13w24b, Snapshot 13w25a, Snapshot 13w25b, Snapshot 13w25c, Minecraft 1.6, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w03b, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 1.8, Minecraft 1.8.7, Minecraft 1.8.8, Minecraft 15w31a, Minecraft 15w36d, Minecraft 15w38a, Minecraft 15w38b, Minecraft 15w39b, Minecraft 15w39c, Minecraft 15w43b, Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, Minecraft 15w47c, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w06a, Minecraft 16w07a, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 16w15a, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2
Fix Version/s: Minecraft 16w32a

Type: Bug
Reporter: [Mojang] Panda Assignee: [Mojang] Jeb (Jens Bergensten)
Resolution: Fixed Votes: 72
Labels: None

Attachments: PNG File 2013-03-24_22.32.08.png     PNG File 2013-03-24_22.32.14.png     PNG File 2015-09-19_01.12.23.png     PNG File 2015-09-19_01.12.33.png    
Issue Links:
Duplicate
is duplicated by MC-8388 Dispenser Bugs Resolved
is duplicated by MC-8391 Vertical Dispensers and Mobs Resolved
is duplicated by MC-9444 Upward dispensers with mob eggs spawn... Resolved
is duplicated by MC-9797 Upward dispenser mob bug. Resolved
is duplicated by MC-10053 Dispenser directed up will suffocate ... Resolved
is duplicated by MC-11436 Vertical dispenser glitch Resolved
is duplicated by MC-12274 Mobs falling through upwards facing d... Resolved
is duplicated by MC-12414 Upwards facing dispenser spawning mob... Resolved
is duplicated by MC-17758 Up and Down-facing dispensers don't s... Resolved
is duplicated by MC-18599 Mobs Spawned By Upward Dispenser Spaw... Resolved
is duplicated by MC-49952 Small slimes die when you dispense th... Resolved
is duplicated by MC-50466 Dispenser that are pointing upwords d... Resolved
is duplicated by MC-65853 Mobs are in dispenser by spawning Resolved
is duplicated by MC-82016 Dispencers facing down dispencing mobs Resolved
is duplicated by MC-83114 Dispensers Resolved
is duplicated by MC-91212 When using spawn eggs with dispenser,... Resolved
is duplicated by MC-97344 Dispencers Resolved
is duplicated by MC-103936 upwards Dispenser spawns mob inside i... Resolved
Relates
relates to MC-130730 Entities suffocate when using spawn e... Open
relates to MC-123420 entities go inside blocks Resolved
CHK:
Confirmation Status: Confirmed

 Description   

Upwards and downwards facing dispensers with spawn eggs will spawn the mob inside the dispenser (instead of on top/below it).
This can cause small mobs (e.g. chicken, silverfish) to suffocate inside the dispenser.

Steps to reproduce
1. Place an upwards facing dispenser on the foor. 2015-09-19_01.12.23.png
2. Put spawn eggs in it (e.g. Creeper)
3. Trigger the dispenser.
4. The mob is inside the dispenser, and not as expected on top of it. 2015-09-19_01.12.33.png

Fix
The simplest fix would be to just add the offset to the spawn position of the mob as it is done for x and z already.

Bootstrap.java (in MCP)
         public ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
            EnumFacing var3 = BlockDispenser.getFacing(source.getBlockMetadata());
            double var4 = source.getX() + (double)var3.getFrontOffsetX();
            // Added  "+ (double)var3.getFrontOffsetY()"
            double var6 = (double)((float)source.getBlockPos().getY() + 0.2F) + (double)var3.getFrontOffsetY();
            double var8 = source.getZ() + (double)var3.getFrontOffsetZ();
            Entity var10 = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), var4, var6, var8);
            if(var10 instanceof EntityLivingBase && stack.hasDisplayName()) {
               ((EntityLiving)var10).setCustomNameTag(stack.getDisplayName());
            }

            stack.splitStack(1);
            return stack;
         }

This fix would be ok already, but for downwards facing dispensers it would still spawn two high+ mobs inside the dispenser with their head.
So the fancy way may be to subtract the height of the mob for downwards facing ones.
Then again this is not done for sideways ones either so I guess just adding the offset would be "as expected"



 Comments   
Comment by Fabian Röling [ 10/Aug/16 ]

I think the most intuitive, consistent and further bug-preventing would be to put the top of the hitbox at the bottom edge of the dispenser. Should be tested with custom spawn eggs with huge slimes.

Comment by [Mojang] Jeb (Jens Bergensten) [ 09/Aug/16 ]

As mentioned in the description, still doesn't work perfectly for downwards-facing dispensers. Mainly a bit tricky to know how much to offset the entity, since there may be a floor below the dispenser as well

Comment by null (Inactive) [ 22/Jun/16 ]

Confirmed for 1.10.1.

Comment by Sam Bone [ 21/Jun/16 ]

Also duplicated by MC-103936.

Comment by null (Inactive) [ 08/Jun/16 ]

Confirmed for 1.10.

Comment by null (Inactive) [ 07/Jun/16 ]

Confirmed for 1.10-pre2.

Comment by null (Inactive) [ 03/Jun/16 ]

Confirmed for 1.10-pre1.

Comment by null (Inactive) [ 26/May/16 ]

Confirmed for 16w21b.

Comment by null (Inactive) [ 25/May/16 ]

Confirmed for 16w21a.

Comment by null (Inactive) [ 18/May/16 ]

Confirmed for 16w20a.

Comment by null (Inactive) [ 11/May/16 ]

Confirmed for 1.9.4.

Comment by null (Inactive) [ 06/May/16 ]

Confirmed for 1.9.3-pre3.

Comment by Jackietheboy d [ 14/Apr/16 ]

Confirmed for 16w15b

Comment by Sealbudsman [ 15/Feb/16 ]

Affects 16w07a.

Comment by Roy Sajima [ 15/Feb/16 ]

Confirmed for 16w06a.

Comment by James (inactive) [ 13/Jan/16 ]

Confirmed for 16w02a.

Comment by James (inactive) [ 21/Dec/15 ]

Confirmed for 15w51b.

Comment by Kumasasa [ 18/Sep/15 ]

Changed reporter to panda4994

Comment by [Mojang] Panda [ 17/Sep/15 ]

Can confirm for 15w38b.

Comment by [Mojang] Panda [ 05/Sep/15 ]

Can confirm for 1.8.8 and 15w36d.

Comment by Marcono1234 [ 03/Jul/15 ]

Confirmed for

  • 1.8.7 (also based on MC-82016) for downwards facing dispensers as well
Comment by Pete Frisky [ 14/Nov/14 ]

Still bugged in 1.8.1 pre4.

Comment by John Wages [ 06/Sep/14 ]

I want to make a hidden dispenser in the wall that will drop mobs, and this bug is not letting me do it simply at all.
Still in 1.8

Comment by Thrashkal . [ 29/Jul/13 ]

Pretty annoying bug.
Looks like devs don't care of it.
It'll be very easy to fix, just add +2 y over the dispenser to have a good spawn location

Comment by sam tunder [ 28/Jul/13 ]

was able to reproduce in 1.6.2! so its still there!

Comment by Samuel Jones [ 11/Jul/13 ]

Still in 1.6.2.

Comment by [Mod] Ezekiel (ezfe) [ 10/Jul/13 ]

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.

Comment by Roman Kasparian [ 01/Jul/13 ]

Stil in 1.6.1.

Comment by Platypus [ 20/Jun/13 ]

This is still in 13w25a/b/c.

Comment by Ben Woodworth [ 13/Jun/13 ]

http://www.youtube.com/watch?v=ymfFVPisLG4

Comment by [Mod] Torabi [ 26/Mar/13 ]

Issues are addressed roughly in order by number of votes. This issue currently ranks #62.

Comment by Morgan Nolan [ 24/Mar/13 ]

Needs to be fixed ... please

Comment by Morgan Nolan [ 24/Mar/13 ]

screenshot '2013-03-24_22.32.08'
Is me spawning a wolf
screenshot '2013-03-24_22.32.14'
Is the wolf dien

Comment by Nicolous smithbobjuniour [ 07/Mar/13 ]

yah this isnt resolved, mojang needs to refix this pronto!

Comment by Alan Young [ 07/Mar/13 ]

This is still happening in the 1.5 prerelease. Please fix.

Generated at Sun Jan 12 12:17:18 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.