Skip 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.

warjort

Members
  • Joined

  • Last visited

Everything posted by warjort

  1. public static final RegistryObject<EntityType<FriedSnowball>> FRIED_SNOWBALL_ENTITY = ENTITY_TYPES.register("fried_snowball_entity", () -> EntityType.Builder.<FriedSnowball>of(FriedSnowball::new, MobCategory.MISC) .sized(0.25F, 0.25F).clientTrackingRange(4).updateInterval(10).build(null)); You are not calling build() for your builder and you need to tell it the type parameter for the builder because its one of those things where java's type inference doesn't work, it's trying to use EntityType<Entity> from the ENTITY_TYPES.
  2. You can also do it like this: @Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class EventHandler { @SubscribeEvent public static void onEntityAttributeModificationEvent(EntityAttributeModificationEvent event) { event.add(EntityType.PLAYER, modAttributes.CRIT_CHANCE.get()); } }
  3. That code is still not using the Mod EventBus, your "bus" variable.
  4. This looks like this issue? https://github.com/MinecraftForge/MinecraftForge/issues/8649 which was fixed in forge 40.1.33, you have 40.1.0 try updating forge (latest is 40.1.67) to see if fixes your problem.
  5. Its a good idea to put configuration and runtime code in different classes.
  6. The error says it doesn't have the attribute. Hard to tell because you don't show the full context, but I guess you are listening on the main event bus instead of the mod event bus for the EntityAttributeModificationEvent?
  7. It downloads the mojang jar(s) at installation and modifies them. You still need a minecraft license. How are users creating their mods from scratch, are users decompiling mojangs servers fat jars and starting there for their mods? As in, if I wanted to create a mod that introduced a new custom mob, wouldn't I need to somehow look at how actual mobs are being built by decompiling then make a similar model and repackage the jar and rerun the app? The mdk is an example mod. You actually just need ForgeGradle that the mdk uses. Mods are gradle projects. https://docs.minecraftforge.net/en/latest/gettingstarted/ Forge for 1.12 is old and no longer supported. Use 1.18.2 if you are getting started.
  8. Also your log contains some message about mystical agriculture not finding a tinkers construct registry. So you may have a mismatch between versions of these mods.
  9. You have a broken config file. config/buildinggadgets-server.toml Delete it and it will recreate it with default values. Usually this happens when your computer doesn't shut down properly (e.g. power outage) and you end up with more than 1 corrupted config file. So if it happens again, check your log to find a similar error message and see what the next broken file is.
  10. Your code compiles fine for me. Just a guess, but what is your import for Supplier? It should be from java.util.function, not the one from google or netty. Otherwise, check your other imports with the types used by registerMessage(). Not related to your problem and just a style thing, but you would normally define the encoder as a class instance method, then the first parameter is implicitly passed as "this". And methods that not getters are usually named using the verb rather than the noun, e.g. public void encode(FriendlyByteBuf buffer){ buffer.writeInt(this.tAccessed); buffer.writeInt(this.tCrafted); buffer.writeBoolean(this.hAccessed); buffer.writeBoolean(this.hCrafted); }
  11. Update forge, twighlight forest needs a later version
  12. But you only need it if you have extra data to pass. For future reference using IContainerFactory would look something like this () -> new MenuType<>((IContainerFactory<Crate_WhiteOakGuiInv>) Crate_WhiteOakGuiInv::new) where the constructor has signature (int, Inventory, FriendlyByteBuf)
  13. The null is the "extraData". It's from forge's IContainerFactory, which you can pass to the MenuType constructor instead. It's a subclass of MenuType.MenuSupplier. Using a lambda means it won't be an IContainerFactory, so the parameter is redundant. Using that IContainerFactory means you can pass extra data to the client when you open the screen. See the NetworkHooks.openScreen() methods and MenuType.create()
  14. public static final RegistryObject<MenuType<Crate_WhiteOakGUIMenu>> WHITE_OAK_CRATE_GUI = REGISTRY.register("white_oak_crate_gui", () -> new MenuType<>((id, inv) -> new Crate_WhiteOakGUIMenu(id, inv))); You are also not even using the MenuType constructor, or using a supplier for the object. It should be more like the above.
  15. Look at the MenuType constructor. It takes a MenuType.MenuSupplier. That functional interface's method takes 2 parameters while you have 3 in your lambda.
  16. Remove rubidium from the server, you don't need it. Maybe one day, the rubidium developer will fix this bug? ๐Ÿ™‚
  17. You will probably find it easier to get rid of the registerMenu() method and just write the register directly in the static initializer(s). That way the compiler will have more opportunity to infer the correct generic parameters.
  18. That is probably because you are trying to register MenuTypes in a DeferredRegister<Container> Like I said above, try to figure this out for yourself. That means spending time on it to understand what the compiler is telling you, not dumping the compiler errors here for us to fix without you engaging your brain. ๐Ÿ™‚
  19. I think you need to take a step back and understand what you are doing. You can't just keep posting compiler errors from random code you write here.
  20. Its more like <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> Your return type is the RegistryObject, the T is a generic parameter definition. I was too hung up on the weird double brackets. ๐Ÿ™‚
  21. - RegistryObject<<T extends AbstractContainerMenu> MenuType<T>> + RegistryObject<T extends AbstractContainerMenu> MenuType<T>

Important Information

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

Account

Navigation

Search

Search

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.