-
Notifications
You must be signed in to change notification settings - Fork 9
Advance Features!
here a quick list of features!
- Custom Items & blocks
- multi texture for Items
- Custom Block entities
- Custom Recipes (Can not override CR's Recipes)
- Custom Commands
- Zone generators (Custom world generator)
- Customization your Mod page (Mod's bottom page in ModMenu)
notes: most of these features are already available in the mod example
DataMods can be add into the jar of your mod, good for if you want to add a base block!
Before we go down the list, Your Mod class file need to have PuzzleRegistries.EVENT_BUS.register(this);
inside onInit() method. This is necessary to register most of the features!
To create an Item in java do the following...
-
Create class & implements
IModItem. -
Import the necessary method
IModItemneeds. -
Now in Mod class in
onInit()doIModItem.registerItem(new YOUR_ITEM_CLASS()); -
To add an texture call
addTexture(IModItem.MODEL_2_5D_ITEM, new ResourceLocation(Constants.MOD_ID, "textures/items/TEXTURE_NAME.png"))in your Item class Constructor. -
If your item need to have multiple texture use the same
addTexture -
To forces Item texture to change use
setCurrentEntry.
To create an Block just need to implement IModBlock
- Import the necessary method
IModItemneeds.
Blocks States is part of CR game and is how blocks are render & interact with!
- To start Override
getBlockGenerator()with your block. - Create a new
BlockGenerator(). - Call
createBlockState()this will return anState& you use this method to create more blocks states! - If you need an Block Entity use
addBlockEntity().
If an block needs to be tick or store items it best to use an Block Entity
- Your class need to extends
ExtendedBlockEntity. - Import the necessary constructor
ExtendedBlockEntityneeds. - After that just need to register it by use
BlockEntityCreator.registerBlockEntityCreator().
Creating an Command is simple CommandManager.literal("YOURCOMMAND") use ExampleMod Command as a guide.