Posted August 1, 20196 yr The old method for registering entities doesn't work any more. I saw there was a new method that which takes a Resource Location. I was wondering, if someone could tell me, what kind of ResourceLocation I need and if there is anything else I need to pay attention to. Obviously I know I should use the Registry Events but I'm kinda lazy and I'll have to write everything from scratch anyway when forge is done. Anyway, if someone can link me on a write-up or example on the entity registry, I'll happily take that, too. EntityRegistry.registerModEntity(EntityGargoyle.class, "biodiversityGargoyle", 0, Biodiversity.MODID, 128, 1, true, 0x262626, 0x666666); One other random question: How does the setting of spawner base logic work nowadays? Not like this (there is a Resource Location missing as well). if(ConfigHandler.genvespiaryspawner){ TileEntityMobSpawner tileEntity = (TileEntityMobSpawner) world.getTileEntity(new BlockPos((i + 4), (j + 1), (k + 4))); if (tileEntity != null) { (tileEntity).getSpawnerBaseLogic().setEntityId("biodiversity.biodiversityWasp"); } Any help is appreciated. Thanks in advance.
August 1, 20196 yr Entities are registered through the EntityEntry registry event. This can be accessed using EntityEntryBuilder#create and finished with EntityEntryBuilder#build to get the EntityEntry. There are a number of optional and required parameters such as EntityEntryBuilder#spawn or EntityEntryBuilder#id respectively that can be chained before ending with EntityEntryBuilder#build. Spawners are set using MobSpawnerBaseLogic#setEntityId like the one used in your example. However, you need the resourcelocation such as "skeleton" or "modid:entityid" if you are not using a Minecraft entity. You can set the id of your entity by chaining EntityEntryBuilder#id to the created instance.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.