• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hey all,   I'm trying to get my spawn eggs to not display as "entity.mob_name.name", but rather as "Spawn mob_name" like Vanilla's spawn eggs. Here is the necessary information.   InitEntities.class public class InitEntities { private static int id = 1500; public static void register() { registerEntity("mob_id", "Mob Name", EntityMob.class, 16167425, 16775294); Utils.getLogger().info("Entities Registered"); } private static void registerEntity(String nameId, String entityName, Class<? extends Entity> entityClass, int eggPrimary, int eggSecondary) { EntityRegistry.registerModEntity(new ResourceLocation(Reference.MODID, nameId), entityClass, entityName, ++id, Reference.MODID, 64, 1, false, eggPrimary, eggSecondary); } }   Main class public static final CreativeTabs creativeTab = new CreativeTabs(CreativeTabs.getNextID(), "modid") { @Override @SideOnly(Side.CLIENT) public void displayAllRelevantItems(NonNullList<ItemStack> itemList) { super.displayAllRelevantItems(itemList); itemList.add(getSpawnEgg("mob_id")); } };   en_us.lang (I've tried both of these separately. No luck.) [All other translations are working fine] #### Entities #### entity.mod_id.mob_id.name=Mob Name entity.mob_id.name=Mob Name   Thanks.
    • Do not make your classes implement IHasBlockModel.Refer here. (Code-Style, #3) Register your items/blocks like this instead.   @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(ModBlocks.BLOCKS); Utils.getLogger().info("Blocks Registered"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS); for (Block block : ModBlocks.BLOCKS) { event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()).setUnlocalizedName(block.getUnlocalizedName())); } Utils.getLogger().info("Items Registered"); } @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { for (Block block : ModBlocks.BLOCKS) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } for (Item item : ModItems.ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } Utils.getLogger().info("Models Registered"); }  
    • Thank you a lot i will try that as soon as I can And I will also try fix all of the code style error   For the iron chest I did just copied the code from the copper one I would have fixed it if I had seen the chest workin
    • Okay so I got a vanilla mob to spawn in over world like so (Only these guys and Zombie Pigman spawn correctly using this code) :   for (Biome biome : ForgeRegistries.BIOMES) {  biome.getSpawns(EntityClassification.MONSTER).add(new Biome.SpawnListEntry(EntityType.PILLAGER, 100, 3, 5));  }   Now I want to give them a spawn condition, such as not spawning within a certain distance from a specified block. Possible?
    • What launcher are you using? Please provide a screenshot.
  • Topics

  • Who's Online (See full list)