Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.