Hello ! I try to spawn a mob via it Registry name, it works very well on my client, but it crash on server, someone would have an idea ?
That's what I have for now
String entityString = "minecraft:zombie";
Entity entity = EntityList.newEntity(EntityList.getClassFromName(entityString), world);
entity.setLocationAndAngles(x, y, z, world.rand.nextFloat() * 360F, 0.0F);
world.spawnEntity(entity);
EDIT : I just tried another way but it still crash on server ...
String entityString = "minecraft:zombie";
ResourceLocation registryName = EntityRegistry.getEntry(EntityList.getClassFromName(entityString)).getRegistryName();
Entity entity = EntityList.createEntityByIDFromName(registryName, world);
entity.setLocationAndAngles(x, y, z, world.rand.nextFloat() * 360F, 0.0F);
world.spawnEntity(entity);