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.

arturkr

Members
  • Joined

  • Last visited

Everything posted by arturkr

  1. Nope) I want to learn java while studying modding)
  2. register in Main public class Main { public static Random random = new Random(); public static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "magic"; public Main() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); Pounder.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { } } I didn't succeed, as you suggested. The instrument was not registered. I did it differently and it appeared in the game, but it still disappears when crafting public class Pounder extends Item{ public Pounder(Properties properties) { super(properties); } public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID); public static final RegistryObject<Item> pounder = Pounder.ITEMS.register("pounder", () -> new Item(new Item.Properties().group(ItemGroup.TOOLS).maxStackSize(1).setNoRepair().maxDamage(63))); @Override public ItemStack getContainerItem(ItemStack stack) { ItemStack ret = stack.copy(); if(ret.attemptDamageItem(1, Main.random, null)) return ItemStack.EMPTY; else return ret; } }
  3. public class ItemInit extends Item{ public ItemInit(Properties properties) { super(properties); } public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID); public static final RegistryObject<Item> pounder = ItemInit.ITEMS.register("pounder", () -> new Item(new Item.Properties().group(ItemGroup.TOOLS).maxStackSize(1).setNoRepair().maxDamage(63))); @Override public ItemStack getContainerItem(ItemStack stack) { ItemStack ret = stack.copy(); if(ret.attemptDamageItem(1, Main.random, null)) return ItemStack.EMPTY; else return ret; } } But when crafting, the item is still spent
  4. Yes, this is for a custom item. But I don't know how to override yet ... My ItemInit.java public class ItemInit { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID); public static final RegistryObject<Item> pounder = ITEMS.register("pounder", () -> new Item(new Item.Properties().group(ItemGroup.TOOLS).maxStackSize(1).setNoRepair().maxDamage(63))); } My Main.java public class Main { public static Random random = new Random(); public static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "magic"; public Main() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { } } Can you tell me where to override?๐Ÿ˜…
  5. Is it possible in more detail?๐Ÿ˜… Just starting to learn modding for mc
  6. How to prevent an item from being wasted during crafting? Something like crafting a cake. I know that a bucket of milk is prescribed, that they do not waste when crafting. But I can't do this so that the item is not spent during crafting. Ideally, make it so that with each craft -1 durability. I started digging towards ActionResult <ItemCraftedEvent> but to no avail so far. Help me please translated by Google Translate))

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.