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.

VGLyen

Members
  • Joined

  • Last visited

Everything posted by VGLyen

  1. Ok, thank you. But I have still some issues. The documentation says: In order to make Minecraft load and be aware of your loot table, simply call LootTableList.register(new ResourceLocation("modid", "loot_table_name")), which will resolve and load /assets/modid/loot_tables/loot_table_name.json. This call can be made during any of preinit, init, or postinit. You may organize your tables into folders freely. But this doesn't work for me. Probably because I use a newer version which is not documented yet. I've searched a while for a good example, but I did not find anything. If you could help me a second time, this would be awesome. And a second question: The documentation says: When a block is registered, only a block is registered. The block does not automatically have an ItemBlock. To create a basic ItemBlock for a block, one should use new ItemBlock(block).setRegistryName(block.getRegistryName()). The unlocalized name is the same as the block’s. Custom subclasses of ItemBlock may be used as well. Once an ItemBlock has been registered for a block, Item.getItemFromBlock can be used to retrieve it. Item.getItemFromBlock will return null if there is no ItemBlock for the Block, so if you are not certain that there is an ItemBlock for the Block you are using, check for null. Is this really outdated for 1.14.3? Because it would be easier if I just could use this instead of a whole .json File only to drop the Block itself. Thanks for the help.
  2. Hello guys. It's been a while since I programmed with Forge and everything changed since. (I think the last time was on Minecraft Version 1.8.8) I've already searched for examples but everything I found was outdated. So these are my files. What I want is, that after you destroyed the Ore you get the Block as an Item. @Mod.EventBusSubscriber(modid = Reference.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) @ObjectHolder(Reference.MODID) public class BlockRegistry { public static final Block cyby_ore = null; @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( new CybyOre(Block.Properties.create(Material.ROCK)).setRegistryName(Reference.MODID, "cyby_ore") ); } } public class CybyOre extends Block { public CybyOre(Properties prop) { super(prop.hardnessAndResistance(3.0f, 3.0f).harvestLevel(3).harvestTool(ToolType.PICKAXE).lightValue(15/16)); } } @Mod.EventBusSubscriber(modid = Reference.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) @ObjectHolder(Reference.MODID) public class ItemRegistry { public static final Item cyby_ingot = null; public static final Item cyby_ore = null; @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll( new Item(new Item.Properties().group(ItemGroup.MATERIALS)).setRegistryName(Reference.MODID, "cyby_ingot"), new BlockItem(BlockRegistry.cyby_ore, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(Reference.MODID, "cyby_ore") ); } } In Minecraft 1.8.8 you did it like this: @EventHandler public void init(FMLInitializationEvent event) { /*Blocks*/ CybyOre = new CybyOre(CybyOreID, Material.rock).setUnlocalizedName("CybyOre").setCreativeTab(tabModBlock); GameRegistry.registerBlock(CybyOre, "CybyOre"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(CybyOre), 0, new ModelResourceLocation("MODID:CybyOre", "inventory")); } At this moment it is just a guessing game where I need to put it and I feel pretty dumb. Hope you can help me, and please be kind. Thanks BlockRegistry.java CybyOre.java ItemRegistry.java

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.