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.

Amtsapparat

Members
  • Joined

  • Last visited

Everything posted by Amtsapparat

  1. Thank you! That's the solution! I'm sorry for being that dumb, I'm new to Forge Mod coding. Thank you all for helping me that fast!
  2. Okay, but if I create an item for the block, it is visible in the creative inventory, but I can't place it since it is an item, not a block.
  3. The issue is, that the block in not shown in the creative inventory in mc. Also if I try to give it to me (/give ...), it won't work. I've checked all the json files again, but I can't find any mistake.
  4. Hello. I already have that in my Mod Constructor. Here is the full 'Main' class: @Mod(Info.MODID) public class Main { public Main() { final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Info.MODID); BLOCKS.register("block_x", () -> new Block(Block.Properties.of(Material.STONE))); BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); } }
  5. First of all thank you for that fast reply. In my 'Main' I do now have: final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Info.MODID); BLOCKS.register("block_x", () -> new Block(Block.Properties.of(Material.STONE))); BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); but still it doesn't work... Do I need to use 'TileEntityType'?
  6. Hello everyone! I've got a problem with creating blocks in MC. I've tried both options from the official Forge Docs and also some other suggestions from other forums and videos. I really don't know what's the error here. Items work ingame, blocks don't. I created a class called 'Blocks', which extends net.minecraft.block.Block. Here's the code: public class Blocks extends Block { public static final List<Block> blocks = new ArrayList<Block>(); public Blocks(String name) { super(Properties.of(Material.STONE, MaterialColor.STONE).strength(60f, 120f).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.METAL)); setRegistryName(Info.MODID, name); // Info is basically another class with lots of info for the mod, such as credits, modid, version etc. blocks.add(this); } } In my 'Main' I have: public class Main { public Main() { new Blocks("block_x"); } @SubscribeEvent public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegE) { blockRegE.getRegistry().registerAll(Blocks.blocks.toArray(new Block[0])); } } Ingame no block is there. Also of course I have 'block_x' as .json files in assets.(MODID).blockstates, assets.(MODID).models.block, assets.(MODID).models.item I've also got the texture in the assets.(MODID).textures folder. Does anybody know why the block isn't registering?

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.