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.

no namezzzz

Members
  • Joined

  • Last visited

  1. OK how should I do it?
  2. Problem is solved. The main reason is ItemGroup and I don't have any thoughts about why does it occur the problem
  3. @SubscribeEvent public static void onRegisterItem(RegistryEvent.Register<Item> event) { Item item = new Item(new Item.Properties().rarity(Rarity.EPIC)); item.getCreativeTabs().add(ItemGroup.COMBAT); item.setRegistryName("test"); event.getRegistry().registerAll(item); } I just created item in registry method, but i've got another error.
  4. package sobbaches.tuto; import net.minecraftforge.fml.common.Mod; @Mod(Tuto.MODID) public class Tuto { public static final String MODID = "tuto"; } package sobbaches.tuto; import static sobbaches.tuto.Items.items; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.Rarity; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.IForgeRegistry; @Mod.EventBusSubscriber(modid = Tuto.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class TutoEventSubscriber { @SubscribeEvent public static void onRegisterItem(RegistryEvent.Register<Item> event) { items.forEach(item -> item.getCreativeTabs().add(ItemGroup.COMBAT)); items.forEach(event.getRegistry()::registerAll); } } package sobbaches.tuto; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.Rarity; import net.minecraft.util.ResourceLocation; import java.util.ArrayList; import java.util.List; public class Items { public static final List<Item> items; static { items = new ArrayList<>(); items.add(new Item(new Item.Properties().rarity(Rarity.EPIC)) .setRegistryName(new ResourceLocation(Tuto.MODID, "test"))); } }

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.