mojira.dev
MC-61800

Non-OP Adventure players can change spawner types, breaking pre-14w28 maps

What I expected:
Non-OP survival and adventure players would not be able to configure spawners using spawn eggs, or at least some means of preventing spawner configuration would exist.

What actually happened:
Spawn eggs can be used to configure spawners without any restrictions in Survival and Adventure. No gamerule or NBT tag affects this behavior either.

Why this is a valid issue:
This issue is valid on the same grounds MC-2367 and MC-3066 were valid (and have since been fixed): a change to the game has broken adventure maps and minigames by adding an unfixable exploit, and the change cannot be avoided.

Any map where spawners and spawn eggs are accessible to players is affected, and such maps cannot be fixed to work properly on post-14w28 versions of Minecraft. Exploits range from game balance issues (easily disabling hostile spawners, cheaply obtaining spawner types which are intended to be expensive, or creation of spawners not intended to be found in the map), to game-breaking issues where a player's accident can render the map unplayable (this is especially true of maps where spawn eggs are used to cast spells).

Steps to Reproduce:

  1. Obtain a spawner with a command such as "/give @p minecraft:mob_spawner"

  2. Place it, and observe that it is a pig spawner.

  3. Use a (non-pig) spawn egg on it, and observe that it changes type.

  4. Make sure you have another spawn egg of a different type in your inventory.

  5. Switch to Survival or Adventure mode, and deop yourself (if applicable).

  6. Use the other spawn egg on the spawner. Observe that you can still change its type.

Linked issues

Comments 9

Ya this probably needs to be only available to creative mode

There are many many other things 1.8 will break pre-1.8 maps. The game has been changed. This is a very minor issue compared to things like ID changing and Adventure Mode. Nevertheless, I think changing the mob in the spawner should be left for Creative Mode. Although, I'm not sure why you would give a player a spawn egg in a map.

The difference is mainly in terms of workarounds, which allow a mapmaker to fix their map so it works properly post-1.8. Although inconvenient, you can revert the Adventure Mode changes by having clocks which apply the appropriate NBT tags to newly-obtained tools/swords and blocks (alternatively, if you only needed a subset of the pre-1.8 behavior, you only need to apply the tags to the desired tools/swords/blocks and may be able to get away with not using a clock). ID changing is a larger issue, although some options still exist:

  • If you were using invalid block IDs such as air:1 to mark blocks for later modification without changing their appearance, you could alternatively create invisible WitherSkulls in their areas and use /execute on them.

  • If you were using invalid block IDs for their appearances (such as piston crates), you can recreate them by using a model-altering resource pack (for example, replace one of the two identical all-pores or all-stem mushroom blocks with piston crates, as these blocks are not naturally-occurring) and apply an MCedit filter to fix the broken blocks in your world.

  • If you were using invalid item IDs to distinguish special items in your commands, you can now use custom NBT. One of 1.8's features is that custom item tags are saved.

  • If you were using invalid item IDs for their appearances, I don't think there's any clean workaround (apart from using a resource pack to change the model of some item otherwise unobtainable in your map. Note that you can now package your pack inside the map to have it automatically use it). However, most of the damage was done with 1.7's item removals; 1.8 only removed a small handful such as doubleslabs.

I am switching to using all of these workarounds, but I'm fine with it because at least workarounds for these changes exist.

I'm not sure any workarounds exist for this spawn egg issue. The only thing I can think of is to stop giving the player spawn eggs, and instead replace them with "summon signs": signs with NBT which summon the desired mob and destroy themselves when right-clicked. That's not ideal, as they require an empty space clear of mobs to be placed, can't create baby mobs (which is desirable in some maps), and require two right-clicks to use. The workarounds I mentioned for the other changes don't change gameplay for the player; they just require changes to the redstone/commands which run the map, and possibly adding a resource pack (which, as I mentioned, can automatically load).

There are a few good reasons for giving players spawn eggs in maps. I've seen some maps/concepts use spawn eggs for spellcasting. For example, silverfish and endermite eggs create their respective mob (which otherwise never appears in the map), and each is replaced with some magical effect (whether it be teleportation, a combat spell, summoning a structure, etc.). Spawn eggs can also be useful to give a player a way to replenish (or create) a population of mobs in a location they don't ordinarily spawn (such as a farm, or an extradimensional building plot only accessible via teleportation*). They can also be handy in combat situations - particularly in the case of creeper spawn eggs (I've seen many PvP minigames offer hostile mob eggs, and some do have exposed spawners for some reason or another). There's also the concept of transforming mobs into spawn eggs for easy storage/transport, although I'll admit I haven't seen anybody use it in an adventure map.

* This is actually among the reasons spawn eggs are available in a map I'm co-developing. We also planned to use them in combat summoning and a silverfish spleef minigame.

I don't see the point in having the ability to alter a mob spawner with an egg. In fact, I never knew this could be done before today. Perhaps Mojang should just remove that feature entirely.

Confirmed for 1.8-pre3.

1.8: Non-OP adventure mode players can no longer use spawn eggs to change spawners, but non-OP survival/creative players still can. I'd consider this fixed.

Yes, non-opped players being able to do so in survival mode is irrelevant for this case.

Confirmed for 1.9-pre4

@@unknown This report was closed because adventure mode was changed to not allow placing mob eggs into spawners, which is still the case in 1.9 pre-4.

WolfieMario

(Unassigned)

Confirmed

exploit, security, spawn-egg, spawner

Minecraft 14w28b, Minecraft 1.8-pre3

Minecraft 1.8

Retrieved