diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index a5fec06b83..2d070f8ee0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -24,7 +24,8 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa } public EntityType getSpawnedType() { - return EntityType.fromName(spawner.getSpawner().getMobName().a()); + MinecraftKey key = spawner.getSpawner().getMobName(); + return (key == null) ? EntityType.PIG : EntityType.fromName(key.a()); } public void setSpawnedType(EntityType entityType) {