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.

CubeFlo

Members
  • Joined

Everything posted by CubeFlo

  1. Thanks, it should work now. I think I read somewhere it was okay to use static initializers if you added the ObjectHolder-annotation (not only for injecting values). I probably misunderstood this.
  2. Hello everyone, I created an Entity for my Mod. It works fine, but when I create a new registry inside the NewRegistry-Event, summoning the Entity will result in an error. I have this code: @GameRegistry.ObjectHolder(WizardItemsMod.MOD_ID) public static class ENTITY_ENTRIES { public static int ID = 0; public static EntityEntry FLYING_BROOMSTICK = EntityEntryBuilder.create() .entity(EntityFlyingBroomstick.class) .tracker(64, 20, true) .id("wizarditems:flying_broomstick", ID++) .name("flying_broomstick").build(); } // ... @SubscribeEvent public static void registerEntities(RegistryEvent.Register<EntityEntry> event) { event.getRegistry().register(ENTITY_ENTRIES.FLYING_BROOMSTICK); } @SubscribeEvent public static void newRegistry(RegistryEvent.NewRegistry event) { // when I add the following code, using the Entity will fail SPELL_REGISTRY = new RegistryBuilder<Spell>() .setName(new ResourceLocation("wizarditems", "magic_spells")) .setType(Spell.class) .setIDRange(0, SPELLS4REGISTRY.length).create(); } When I try to summon the Entity using /summon wizarditems:flying_broomstick, I get this error (although the chat displays "Object successfully summoned"): When I load an existing world containing the entity, the game crashes: As I said, this only happens when I add the code for creating the new registry. Does anyone know why this is happening, because creating a new registry shouldn't affect Entities??? Am I doing anything wrong? I found out that this could have something to do with the ModContainer and calling Loader.instance().activeModContainer(). (Interestingly, I had to add my Mod-ID to every registry name (Blocks, Items, ...) once I added the code for the new registry, because suddenly the domain name wasn't automatically set to my Mod's ID.) Thanks in advance!

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.