Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/30/24 in all areas

  1. I myself am quite new to the modding scene, I started modding in February but have been in development hell a lot and have struggled to focus on one mod though I have been developing the current mod I've been working on since September and have made a lot of progress; during this time I have found a lot of helpful resources and have learnt a lot of things. 1. You can, I have had no Java experience previously and since modding have managed to be quite knowledgeable in Java. 2. Modding does not require massive teams, I and many others work alone, though having a team is certainly helpful in the modding process to get things done in a quicker and more organised way. 3. I absolutely have to recommend ModdingByKaupenjoe, he makes loads of tutorials for Minecraft from 1.16.5 and above with support for Forge, Fabric, and as of his 1.21 tutorials, Neoforge. These tutorials are really well made, covering almost every modding topic, (such as items, blocks, mobs, worldgen, etc.) and are pretty easy to follow, and Kaupenjoe always leaves the link to his GitHub repositories where you can view the code of that tutorial at your own pace as well as linking textures in the description of his videos for you to use. These forums are also quite good if you need help, though I have found that it sometimes takes a little while for a response but it is always worth the wait; from my experience the people on these forums have always been kind and helpful. There are also user-submitted tutorials that may be helpful as well. Using GitHub to search up a certain class that you are wanting to use in your mod is also quite helpful, the video I have linked goes into more detail. I would also recommend planning out your mod before you make it to have a clearer idea of how you want your mod to be, including sketches and annotations are also a good idea for this. It has helped me make progress a lot quicker when programming as I already know how I want things to look/act. I hope all this information helps!
    1 point
  2. If you mean the CreativeModeTabEvent.Register event, to register your own tab, you need to create a listener on the mod bus @Mod.EventBusSubscriber(modid = "your_mod_id", bus = Mod.EventBusSubscriber.Bus.MOD) public class CreativeTabEvents { @SubscribeEvent public static void onRegisterCreativeTabs(final CreativeModeTabEvent.Register event) { event.registerCreativeModeTab(new ResourceLocation("your_mod_id", "tab_name"), builder -> builder .icon(() -> new ItemStack(MyModItems.MyItem)) .title(Component.translatable("itemGroup." + "your_mod_id" + "." + name)) //you are not forced to this syntax, but it's pretty common .build()); } } Assuming that MyModItems.MyItem is an item in a class of your mod that has all the items (of course you can set it to whatever item or block you want, even vanilla ones). If, instead, you want to add items to your creative tab, you need to listen to the CreativeModeTabEvent.BuildContents event, in a similar way. In here you want to check which tab is being populated (event.getTab()) and, if is your tab, add as many item stacks as you want using event.acceptAll(itemStacks) method @SubscribeEvent public static void onTabBuildContents(final CreativeModeTabEvent.BuildContents event) { final CreativeModeTab tab = event.getTab(); if(tab.equals(MY_CREATIVE_TAB)) { event.acceptAll(List.of( new ItemStack(MyModItems.MyItem), new ItemStack(MyModItems.MySecondItem) ... )); } } Of course you need to have reference to your tab, so when you register it during the CreativeModeTabEvent.Register event make sure to store the registered tab into a variable so you can use it later on to add items to it. You can see how I handle my tabs here to get an idea: https://github.com/JimiIT92/MineWorld/blob/master/src/main/java/org/mineworld/core/MWTabs.java
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.