Guest User

ModEntityTypes.java

a guest
Nov 18th, 2020
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.leitedesnatado.examplemod.init;
  2.  
  3. import com.leitedesnatado.examplemod.ExampleMod;
  4. import com.leitedesnatado.examplemod.entities.FishyEntity;
  5. import com.leitedesnatado.examplemod.entities.PenguinEntity;
  6.  
  7. import net.minecraft.entity.EntityClassification;
  8. import net.minecraft.entity.EntityType;
  9. import net.minecraft.entity.passive.FoxEntity;
  10. import net.minecraft.util.ResourceLocation;
  11. import net.minecraftforge.fml.RegistryObject;
  12. import net.minecraftforge.registries.DeferredRegister;
  13. import net.minecraftforge.registries.ForgeRegistries;
  14.  
  15. public class ModEntityTypes {
  16.  
  17. public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.ENTITIES, ExampleMod.MOD_ID);
  18.  
  19. public static final RegistryObject<EntityType<FishyEntity>> FISHY_ENTITY = ENTITY_TYPES.register("fishy_entity",
  20. () -> EntityType.Builder.<FishyEntity>create(FishyEntity::new, EntityClassification.WATER_CREATURE)
  21. .size(0.2f, 0.2f)
  22. .build(new ResourceLocation(ExampleMod.MOD_ID, "fishy_entity").toString()));
  23.  
  24.  
  25.  
  26. public static final RegistryObject<EntityType<PenguinEntity>> PENGUIN = ENTITY_TYPES.register("penguin",
  27. () -> EntityType.Builder.<PenguinEntity>create(PenguinEntity::new, EntityClassification.CREATURE)
  28. .size(1.0f, 1.0f)
  29. .build(new ResourceLocation(ExampleMod.MOD_ID, "penguin").toString()));
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. }
  37.  
  38.  
RAW Paste Data