• Posts

    • Thank you Daemon for responding, you are the first person to help me out instead of bringing me down for using a beta version of forge lol. I will remove the Ores Above Diamonds and let you know what happens!
    • I think it would be better if you posted your code from github. Let me guess, you followed a tutorial from HarryTalks, right?
    • That line can't possibly be the reason it's broken unless I'm very confused about java. I got it from a tutorial but it makes sense to me. As for the full code, prepare for a wall of text: EntitiesList.java package com.hoping1.hopingmod.lists; import com.hoping1.hopingmod.HopingMod; import com.hoping1.hopingmod.entities.HopMob; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.SpawnEggItem; import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraft.world.biome.Biomes; import net.minecraftforge.event.RegistryEvent; public class EntitiesList {     public static EntityType<?> HOP_MOB = EntityType.Builder.create(HopMob::new, EntityClassification.CREATURE).build(HopingMod.modid+":hop_mob").setRegistryName(new ResourceLocation(HopingMod.modid, "hop_mob"));     public static Item registerEntitySpawnEgg(EntityType<?> type, int color1, int color2, String name) {         SpawnEggItem item = new SpawnEggItem(type, color1, color2, new Item.Properties().group(ItemGroup.MISC));         item.setRegistryName(new ResourceLocation(HopingMod.modid, name));         return item;     }     public static void registerEntitySpawnEggs(final RegistryEvent.Register<Item> event) {         event.getRegistry().registerAll(             ItemList.hop_mob_egg = registerEntitySpawnEgg(HOP_MOB, 0x00ffff, 0xaaffaa, "hop_mob_egg")         );     }     public static void registerEntityWorldSpawn(EntityType<?> entity, Biome... biomes) {         for (Biome biome : biomes) {             if (biome != null) {                 biome.getSpawns(entity.getClassification()).add(new SpawnListEntry(entity, 1000, 2, 10));             }         }     }     public static void registerEntityWorldSpawns() {         registerEntityWorldSpawn(HOP_MOB, Biomes.FOREST, Biomes.BIRCH_FOREST, Biomes.DARK_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST_HILLS, Biomes.FLOWER_FOREST, Biomes.TALL_BIRCH_FOREST);     } }   HopingMod.java package com.hoping1.hopingmod; import org.apache.logging.log4j.Logger; import com.hoping1.hopingmod.client.render.HopingRenderRegistry; import com.hoping1.hopingmod.lists.ArmorMaterialList; import com.hoping1.hopingmod.lists.BlockList; import com.hoping1.hopingmod.lists.EntitiesList; import com.hoping1.hopingmod.lists.ItemList; import com.hoping1.hopingmod.lists.ToolMaterialList; import com.hoping1.hopingmod.world.OreGeneration; import org.apache.logging.log4j.LogManager; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityType; import net.minecraft.item.ArmorItem; import net.minecraft.item.BlockItem; import net.minecraft.item.HoeItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraft.inventory.EquipmentSlotType; @Mod("hopingmod") public class HopingMod {     public static HopingMod instance;     public static String modid = "hopingmod";     private static Logger logger = LogManager.getLogger(modid);     public HopingMod() {         instance = this;         FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);         FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);         MinecraftForge.EVENT_BUS.register(this);     };     private void setup(final FMLCommonSetupEvent event) {         OreGeneration.setupOreGeneration();         logger.info("Setup method registered");     };     private void clientRegistries(final FMLClientSetupEvent event) {         HopingRenderRegistry.registryEntityRenders();         logger.info("clientRegistries method registered");     }     @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)     public static class RegistryEvents{         @SubscribeEvent         public static void registerItems(final RegistryEvent.Register<Item> event) {             event.getRegistry().registerAll(                 ItemList.hoping_item = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("hoping_item")),                 ItemList.hoping_hoe = new HoeItem(ToolMaterialList.hopingmod, 0.0f, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("hoping_hoe")),                 ItemList.hoping_boots = new ArmorItem(ArmorMaterialList.hopingmod, EquipmentSlotType.FEET, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("hoping_boots")),                 ItemList.hoping_block = new BlockItem(BlockList.hoping_block, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.hoping_block.getRegistryName()),                 ItemList.hoping_ore = new BlockItem(BlockList.hoping_ore, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.hoping_ore.getRegistryName()),                 ItemList.hoping_ore_nether = new BlockItem(BlockList.hoping_ore_nether, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.hoping_ore_nether.getRegistryName())             );             EntitiesList.registerEntitySpawnEggs(event);             logger.info("Items registered");         }         @SubscribeEvent         public static void registerBlocks(final RegistryEvent.Register<Block> event) {             event.getRegistry().registerAll(                 BlockList.hoping_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 3.0f).lightValue(5)).setRegistryName(location("hoping_block")),                 BlockList.hoping_ore = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f, 3.0f)).setRegistryName(location("hoping_ore")),                 BlockList.hoping_ore_nether = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f, 3.0f)).setRegistryName(location("hoping_ore_nether"))             );             logger.info("blocks registered");         }         @SubscribeEvent         public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) {             event.getRegistry().registerAll(EntitiesList.HOP_MOB);             EntitiesList.registerEntityWorldSpawns();             logger.info("entities registered");         }         private static ResourceLocation location(String name) {             return new ResourceLocation(modid, name);         }     } }   No errors and absolutely everything works perfectly except that the HopMob entities don't spawn naturally. If you want code from other files just ask!
    • https://github.com/DragonGamerDevelopers/NewFantasyMod-1.15.1
  • Topics

  • Who's Online (See full list)