Amtsapparat
Members-
Posts
6 -
Joined
-
Last visited
Amtsapparat's Achievements
Tree Puncher (2/8)
0
Reputation
-
Needing help with registering blocks in mc 1.16.5
Amtsapparat replied to Amtsapparat's topic in Modder Support
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! -
Needing help with registering blocks in mc 1.16.5
Amtsapparat replied to Amtsapparat's topic in Modder Support
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. -
Needing help with registering blocks in mc 1.16.5
Amtsapparat replied to Amtsapparat's topic in Modder Support
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. -
Needing help with registering blocks in mc 1.16.5
Amtsapparat replied to Amtsapparat's topic in Modder Support
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()); } } -
Needing help with registering blocks in mc 1.16.5
Amtsapparat replied to Amtsapparat's topic in Modder Support
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'? -
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?