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.

Featured Replies

Posted

 

 

So, i tried so many things and that simply do not work! I tried searching everywhere, watched so many videos and even read some documents specifically about Data Generation, coming here is my last atempt to find a problem to solve it... 

Here's my code:

 

 

Data Generation:

	@Mod.EventBusSubscriber(modid = Enderian.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class DataGenerators { @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); PackOutput packOutput = generator.getPackOutput(); ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider(); generator.addProvider(event.includeClient(), new RecipeProvider(packOutput)); generator.addProvider(event.includeClient(), new BlockStateProvider(packOutput, existingFileHelper)); generator.addProvider(event.includeClient(), new ItemModelProvider(packOutput, existingFileHelper)); BlockTagGenerator blockTagGenerator = generator.addProvider(event.includeServer(), new BlockTagGenerator(packOutput, lookupProvider, existingFileHelper)); generator.addProvider(event.includeServer(), new ItemTagGenerator(packOutput, lookupProvider, blockTagGenerator.contentsGetter(), existingFileHelper)); } }
	

Block State Provider:

	public class BlockStateProvider extends net.minecraftforge.client.model.generators.BlockStateProvider { public BlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) { super(output, Enderian.MOD_ID, exFileHelper); } @Override protected void registerStatesAndModels() { blockWithItem(blocks.PLATINUM_BLOCK); blockWithItem(blocks.DEEPSLATE_PLATINUM); blockWithItem(blocks.PLATINUM_ORE); blockWithItem(blocks.END_PLATINUM); } private void blockWithItem(RegistryObject<Block> blockRegistryObject) { simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get())); }
	

Item Model Provider:

	public class ItemModelProvider extends net.minecraftforge.client.model.generators.ItemModelProvider { public ItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) { super(output, Enderian.MOD_ID, existingFileHelper); } @Override protected void registerModels() { simpleItem(items.BAKED_PLATINUM_POTATO); simpleItem(items.PLATINUM_POTATO); simpleItem(items.FUR); simpleItem(items.RAW_PLATINUM); simpleItem(items.PLATINUM_INGOT); simpleItem(items.PLATINUM_NUGGET); handheldItem(items.EMERALD_SWORD); handheldItem(items.EMERALD_PICKAXE); handheldItem(items.EMERALD_AXE); handheldItem(items.EMERALD_SHOVEL); handheldItem(items.EMERALD_HOE); } private ItemModelBuilder simpleItem(RegistryObject<Item> item){ return withExistingParent(item.getId().getPath(), new ResourceLocation("item/generated")).texture("layer0", new ResourceLocation(Enderian.MOD_ID, "item/" + item.getId().getPath())); } private ItemModelBuilder handheldItem(RegistryObject<Item> item){ return withExistingParent(item.getId().getPath(), new ResourceLocation("item/handheld")).texture("layer0", new ResourceLocation(Enderian.MOD_ID, "item/" + item.getId().getPath())); } }
	

 

BTW, 1.20.1 with Oracle 22.0.1

 

 

Edited by GabrielMa07

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.