Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

hoodzeay

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

hoodzeay's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Unfortunately I cannot replicate the issue, Thanks for the response. We can close this out.
  2. Documentation makes it seem the gradle processes should handle everything, yet they don't. Please don't post if it's not going to be useful, I've ran the task multiple times. I can read. I have it working I just have no clue how I got it to build correctly and complete the downloadAssets task.
  3. I've tried to setup an environment within IntelliJ. I've tried a variety of versions, turning off any software that may prevent the download process and thoroughly looked through posted topics relating to my issue. I've followed the documentation to a T: -Downloaded JDK 16 -Downloaded MDK -Extracted into a folder -Opened said folder into IntelliJ -Executed .\gradlew genIntellijRuns I've refreshed the dependencies countless times and have re-installed the project just as many. Anyone have a clue what's up? > Task :downloadAssets FAILED Execution failed for task ':downloadAssets'. > Failed to get asset: minecraft/sounds/mob/strider/eat3.ogg Some assets failed to download or validate, try running the task again. * Try: > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':downloadAssets'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:145) at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:143) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:131) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61) Caused by: java.lang.RuntimeException: Failed to get asset: minecraft/sounds/mob/strider/eat3.ogg Some assets failed to download or validate, try running the task again. at net.minecraftforge.gradle.common.tasks.DownloadAssets.run(DownloadAssets.java:104) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29) at org.gradle.api.internal.tasks.execution.TaskExecution$2.run(TaskExecution.java:239) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68) at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:224) at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:207) at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:190) at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:168) at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89) at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29) at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:61) at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:42) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27) at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:188) at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75) at org.gradle.internal.Either$Right.fold(Either.java:175) at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:38) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:27) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:109) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:93) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:93) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31) at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40) at org.gradle.api.internal.tasks.execution.TaskExecution$3.withWorkspace(TaskExecution.java:284) at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40) at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33) at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:142) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:131) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
  4. { "type": "minecraft:crafting_shaped", "pattern": [ "X" ], "key": { "X": { "item": "air" } }, "result": { "item": "air" } } resources/data/minecraft/recipes/[XXXXX].json I copied the JSON from the minecraft resources/data/minecraft/recipes and only included the above and it prevented me from crafting the items. Don't know if this helps, just wanted to provide a working example.
  5. Yeah, wasn’t sure where to go from there but I was informed it was wrong anyways. So removed that attempt.
  6. package pooter.pot.pie.StompingGround.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.INBT; import net.minecraft.util.NonNullList; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class ModEnchantmentsRegistry { @SubscribeEvent public static void registerEnchantment(RegistryEvent.Register<Enchantment> event){ SwinglineInator SWINGLINEINATOR = new SwinglineInator(); ConcussiveInator CONCUSSIVEINATOR = new ConcussiveInator(); event.getRegistry().registerAll(SWINGLINEINATOR,CONCUSSIVEINATOR); NonNullList<ItemStack> enchantedBooks = NonNullList.create(); Items.ENCHANTED_BOOK.fillItemGroup(ItemGroup.SEARCH, enchantedBooks); for (ItemStack enchantedBook : enchantedBooks) { if(getStoredEnchantment(enchantedBook).getString() == CONCUSSIVEINATOR.getRegistryName().toString()){ ItemStack enchantedBookCopy = enchantedBook.copy(); } } } /** * Return the enchantment id from the StoredEnchantments tag * @param itemstack * @return */ public static INBT getStoredEnchantment(ItemStack itemstack){ return !itemstack.getTag().isEmpty() ? itemstack.getTag().getList("StoredEnchantments",10).getCompound(0).get("id") : itemstack.getOrCreateTag(); } } I moved the following inside the registerEnchantment event so the two enchantments are no longer a static variable: public static final SwinglineInator SWINGLINEINATOR = new SwinglineInator(); public static final ConcussiveInator CONCUSSIVEINATOR = new ConcussiveInator(); Is this what's meant then? My main purpose with this is to improve my skills, so please pardon my ignorance. I understand many here answer these questions multiple times a day, but it's not mentioned. I've researched what a static initializer is and the explanation from oracle confused me with this application.
  7. Solely for clarification regarding the first point, I should be using a single class to handle all of the registry events. Is that what's meant by I've looked through a few of your previous posts mentioning this and one corrected the issue, but some mods were not updated. The diff looks like that's the solution.
  8. I appreciate the help, It has been a few years since I’ve worked with Java. Should have known to use .equals instead of comparing object references and apologies for bringing basic Java errors in. I’ll try this out and hopefully I can call this solved.
  9. I have figured out how the fillItemGroup method works. I've iterated through all the ItemGroup.SEARCH ItemStack's and found my two by comparing the id to my resource path. I feel like I'm over complicating this. New files are below, had an issue where the two enchantments didn't exist yet so I moved them to the class that registers the enchantments. I thought I could just copy the ItemStack and add the ItemGroup in to it's properties but I was wrong. Mind pushing me in the right direction again? package pooter.pot.pie.StompingGround.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.INBT; import net.minecraft.util.NonNullList; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public class ModEnchantmentsRegistry { public static final SwinglineInator SWINGLINEINATOR = new SwinglineInator(); public static final ConcussiveInator CONCUSSIVEINATOR = new ConcussiveInator(); @SubscribeEvent public static void registerEnchantment(RegistryEvent.Register<Enchantment> event){ event.getRegistry().registerAll(SWINGLINEINATOR,CONCUSSIVEINATOR); NonNullList<ItemStack> enchantedBooks = NonNullList.create(); Items.ENCHANTED_BOOK.fillItemGroup(ItemGroup.SEARCH, enchantedBooks); for (ItemStack enchantedBook : enchantedBooks) { if(getStoredEnchantment(enchantedBook).getString() == ModEnchantmentsRegistry.CONCUSSIVEINATOR.getRegistryName().toString()){ ItemStack enchantedBookCopy = enchantedBook.copy(); } } } /** * Return the enchantment id from the StoredEnchantments tag * @param itemstack * @return */ public static INBT getStoredEnchantment(ItemStack itemstack){ return !itemstack.getTag().isEmpty() ? itemstack.getTag().getList("StoredEnchantments",10).getCompound(0).get("id") : itemstack.getOrCreateTag(); } }
  10. Goal: Add a custom enchantment to an enchantment book, place that enchanted book into a custom creative tab I've tried a few different methods, but I finally gave in and came for help when trying to add it via fillItemGroup on the item. I'm probably doing everything wrong, but I'm solely working off of what I can find in the code base. The first attempt I tried to directly add the group through a new instance of EnchantmentBookItem and setting new properties. Second attempt grabbing the items creative tab and setting it, this caused an error (probably for a good reason). I've primarily been working on trying to find how the game adds them, but it's not easily found since it's not calling the ItemGroup's directly. I've traced ENCHANTED_BOOK back through every usage and didn't see anything, but I'm working on finding where they are added. I'm working through all the methods I find relevant right now. I'm guessing I'm not properly creating the EnchantmentBookItem, applying the enchantment and registering it (which happens to be everything). I'm looking for some guidance as where to go, a point in the right direction would be appreciated. I provided the latest log and debug log just as a safeguard. NOTE: This is never going public, it's a learning environment. So please point out anything that's a mess and could cause problems in the future if applicable. ItemRegistry.java package pooter.pot.pie.StompingGround.items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.NonNullList; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import pooter.pot.pie.StompingGround.enchantment.ModEnchantmentsRegistry; import pooter.pot.pie.StompingGround.inventory.StompingGroundItemGroup; @Mod.EventBusSubscriber(modid="stompingground",bus=Mod.EventBusSubscriber.Bus.MOD) public class ItemRegistry { @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { ItemStack enchantedBook = new ItemStack(Items.ENCHANTED_BOOK); enchantedBook.addEnchantment(ModEnchantmentsRegistry.CONCUSSIVEINATOR,1); NonNullList<ItemStack> itemStackList = NonNullList.create(); itemStackList.add(enchantedBook); enchantedBook.getItem().fillItemGroup(StompingGroundItemGroup.STOMPING_GROUND,itemStackList); event.getRegistry().registerAll(enchantedBook.getItem()); } } StompingGroundItemGroup.java package pooter.pot.pie.StompingGround.inventory; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import pooter.pot.pie.StompingGround.StompingGround; import java.util.function.Supplier; public class StompingGroundItemGroup extends ItemGroup { public final Supplier<ItemStack> iconSupplier; public static final ItemGroup STOMPING_GROUND = new StompingGroundItemGroup(StompingGround.MODID,()->new ItemStack(Items.CAMPFIRE)); public StompingGroundItemGroup(String name, Supplier<ItemStack> supplier){ super(name); this.iconSupplier = supplier; this.setTabPath("stomping_ground"); } @Override public ItemStack createIcon(){ return iconSupplier.get(); } } Debug Log: https://gist.github.com/johnslw26/5a0217bb989490b062826a520543f6b6 latest.log
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.