Jump to content

Bieging

Members
  • Posts

    1
  • Joined

  • Last visited

Bieging's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm actually completely new to modding. Could you help with where I use the DeferredRegister? Or any guide that shows how to use it? Any suggestions to good tutorials that teach how to start modding the best way? Thanks for the reply.
  2. Hello, I'm following Harry Talks 1.14 modding tutorial and got stuck on the Entities part. When defining an entity, I got an error in the function EntityType.Builder.create, that tells "The type TutorialEntity does not define TutorialEntity(EntityType<T>, World) that is applicable here". Code for both classes below TutorialEntities.java import bieg.tutorialmod.TutorialModRegistries; import bieg.tutorialmod.entities.TutorialEntity; import net.minecraft.entity.CreatureEntity; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; import net.minecraft.item.SpawnEggItem; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraftforge.event.RegistryEvent; public class TutorialEntities { public static EntityType<? extends CreatureEntity> TUTORIAL_ENTITY = EntityType.Builder.create(TutorialEntity::new, EntityClassification.CREATURE).build(TutorialMod.modid + ":tutorial_entity").setRegistryName(TutorialModRegistries.location("tutorial_entity")); public static void registerEntitySpawnEggs(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( ItemList.tutorial_entity_egg = registerEntitySpawnEgg(TUTORIAL_ENTITY, 0x32a852, 0x30407a, "tutorial_entity_egg") ); } public static void registerEntityWorldSpawns() { registerEntityWorldSpawn(TUTORIAL_ENTITY, Biomes.PLAINS, Biomes.BEACH, Biomes.JUNGLE); } public static Item registerEntitySpawnEgg(EntityType<?> type, int color1, int color2, String name) { SpawnEggItem item = new SpawnEggItem(type, color1, color2, new Item.Properties().group(TutorialModRegistries.tutorialGroup)); item.setRegistryName(TutorialModRegistries.location(name)); return item; } public static void registerEntityWorldSpawn(EntityType<?> entity, Biome... biomes) { for (Biome biome : biomes) { if (biome != null) { biome.getSpawns(entity.getClassification()).add(new Biome.SpawnListEntry(entity, 10, 1, 10)); } } } } TutorialEntity.java import bieg.tutorialmod.lists.TutorialEntities; import net.minecraft.entity.CreatureEntity; import net.minecraft.entity.EntityType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.goal.LookRandomlyGoal; import net.minecraft.entity.ai.goal.RandomWalkingGoal; import net.minecraft.entity.ai.goal.SwimGoal; import net.minecraft.world.World; public class TutorialEntity extends CreatureEntity { @SuppressWarnings("unchecked") protected TutorialEntity(EntityType<? extends CreatureEntity> type, World worldIn) { super((EntityType<? extends CreatureEntity>) TutorialEntities.TUTORIAL_ENTITY, worldIn); } @Override protected void registerGoals() { this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(0, new RandomWalkingGoal(this, 1.2d)); this.goalSelector.addGoal(0, new LookRandomlyGoal(this)); } @Override protected void registerAttributes() { this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0d); this.getAttribute(SharedMonsterAttributes.ATTACK_SPEED).setBaseValue(2.0d); } } Is it something in the new version of Forge? Best regards.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.