Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
- public class ModEntities {
- public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, MysticsBiomes.MOD_ID);
- //Entities
- public static final RegistryObject<EntityType<StrawberryCowEntity>> STRAWBERRY_COW = ENTITIES.register("strawberry_cow",
- () -> EntityType.Builder.create(StrawberryCowEntity::new, EntityClassification.CREATURE).size(0.9F, 1.4F).build(new ResourceLocation(MysticsBiomes.MOD_ID, "strawberry_cow").toString()));
- //Register Entities Here
- public static void registerEntity() {
- GlobalEntityTypeAttributes.put(STRAWBERRY_COW.get(), StrawberryCowEntity.createMutableAttribute().create());
- }
- public static void setupEntitySpawns(Biome biome) {
- if (biome == ModBiomes.STRAWBERRY_FIELDS.get()) {
- addEntitySpawn(biome, EntityClassification.CREATURE, new MobSpawnInfo.Spawners(ModEntities.STRAWBERRY_COW.get(), 12, 2, 4));
- }
- }
- private static void addEntitySpawn(Biome biome, EntityClassification entityclassification, MobSpawnInfo.Spawners spawners) {
- biome.getMobSpawnInfo().getSpawners(entityclassification).add(spawners);
- }
- @OnlyIn(Dist.CLIENT)
- public static void setupEntitiesClient() {
- RenderingRegistry.registerEntityRenderingHandler((EntityType<? extends StrawberryCowEntity>)STRAWBERRY_COW.get(), StrawberryCowRenderer::new);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement