Advertisement
jayhillx

ModEntities-02

Apr 8th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
  2. public class ModEntities {
  3. public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, MysticsBiomes.MOD_ID);
  4.  
  5. //Entities
  6. public static final RegistryObject<EntityType<StrawberryCowEntity>> STRAWBERRY_COW = ENTITIES.register("strawberry_cow",
  7. () -> EntityType.Builder.create(StrawberryCowEntity::new, EntityClassification.CREATURE).size(0.9F, 1.4F).build(new ResourceLocation(MysticsBiomes.MOD_ID, "strawberry_cow").toString()));
  8.  
  9. public static void registerEntities() {
  10. GlobalEntityTypeAttributes.put(STRAWBERRY_COW.get(), StrawberryCowEntity.createMutableAttribute().create());
  11. }
  12.  
  13. public static void registerEntitySpawns() {
  14. EntitySpawnPlacementRegistry.register(STRAWBERRY_COW.get(), EntitySpawnPlacementRegistry.PlacementType.NO_RESTRICTIONS, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn);
  15. }
  16.  
  17. @OnlyIn(Dist.CLIENT)
  18. public static void setupEntitiesClient() {
  19. RenderingRegistry.registerEntityRenderingHandler(STRAWBERRY_COW.get(), StrawberryCowRenderer::new);
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement