You just give me the inspiration to do the same (of course as soon as I know more about forge and complex stuff😅).
https://thebookofmodding.ml/adding-custom-items/
package com.example.examplemod;
import ...;
public class RegistryHandler {
// create DeferredRegister object
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExampleMod.MODID);
public static void init() {
// attach DeferredRegister to the event bus
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
}
// register item
public static final RegistryObject<Item> COPPER = ITEMS.register("copper", () ->
new Item(
new Item.Properties().group(ItemGroup.MATERIALS)
)
);
}
public static void init() {
// attach DeferredRegister to the event bus
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
}
Personally I register this here in the constructor of my main class, just confirm. And to keep everything organized, I create a class for every DeferredRegister (e.g. the Item DeferredRegister is in a class called "ModItems" and there are all my items), I do this for every DeferredRegister I use, but this is just a small detail and everybody has the freedom to do what he wants. (I register the bus in my mainclass constructor and separate the items from the blocks, the blocks from the potions etc.)
https://thebookofmodding.ml/
I also wanted to ask (I know that 99.99% doesn't respect this anyway, but you should always do it) that you tell the readers on the start page that they should know Java first. As I said before, 99.99% of people don't read it and start right away, they get an error and ask you directly:
- some guy: "Some kind of generic error", hey you! Can you please solve it for me directly? I don't understand anything about generics…
- You: Have you at least learned Java?
(The answer is already: NO)
So you could also just the recommend readers java tutorials in the same way as cadiboo it did (bad english, srry):
https://cadiboo.github.io/tutorials/Pre-requisites/
Last question:
How did you create such a website? And do you pay to host it?
I am interested in it myself (as I said before) and don't know if I should program my own website or rather use a website generator like: Github Beautiful Jekyll. Just asking (and I think it's one of the few website tutorials, though not the only one that supports DarkTheme. Sorry, but this is something to celebrate).
Hope these tips will help you (sorry if it's a bit long)
P.S.:
https://thebookofmodding.ml/loot-tables/
https://thebookofmodding.ml/crafting-and-smeliting-recipes/
I would use a DataGenerator instead of doing this manually. If you want a tutorial about the DataGenerator:
https://mcforge.readthedocs.io/en/latest/datagen/intro/