tutorial:crops
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
tutorial:crops [2021/06/24 21:10] – created crop block page (feel free to make changes) safro | tutorial:crops [2022/12/21 01:41] – item groups in 1.19.3 haykam | ||
---|---|---|---|
Line 61: | Line 61: | ||
===== Registering your Crop and Seed Item ===== | ===== Registering your Crop and Seed Item ===== | ||
- | Now we need to register our crop and the item to use for our seed. The seed model and class will not be covered in this tutorial but you can refer to the [[tutorial: | + | Now we need to register our crop and the item to use for our seed. The seed model and class will not be covered in this tutorial but you can refer to the [[tutorial: |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
Line 68: | Line 68: | ||
public static final CropBlock CUSTOM_CROP_BLOCK = new CustomCropBlock(AbstractBlock.Settings.of(Material.PLANT).nonOpaque().noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP)); | public static final CropBlock CUSTOM_CROP_BLOCK = new CustomCropBlock(AbstractBlock.Settings.of(Material.PLANT).nonOpaque().noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP)); | ||
- | public static final Item CUSTOM_SEEDS = new AliasedBlockItem(TutorialMod.CUSTOM_CROP_BLOCK, | + | public static final Item CUSTOM_SEEDS = new AliasedBlockItem(TutorialMod.CUSTOM_CROP_BLOCK, |
@Override | @Override | ||
public void onInitialize() { | public void onInitialize() { | ||
- | BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), | + | Registry.register(Registries.BLOCK, new Identifier(" |
- | + | Registry.register(Registries.ITEM, new Identifier(" | |
- | Registry.register(Registry.BLOCK, new Identifier(" | + | |
- | Registry.register(Registry.ITEM, new Identifier(" | + | |
} | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You also probably want the '' | ||
+ | |||
+ | <code java [enable_line_numbers=" | ||
+ | @Environment(EnvType.CLIENT) | ||
+ | public class TutorialModClient implements ClientModInitializer { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
} | } | ||
</ | </ | ||
===== Creating our Blockstate and Models ===== | ===== Creating our Blockstate and Models ===== | ||
- | Now that we have finished the registry and code, we can add our models. The example below shows a simple growth stage model that uses the '' | + | Now that we have finished the registry and code, we can add our models. The example below shows a simple growth stage model that uses the '' |
<code JavaScript src/ | <code JavaScript src/ | ||
Line 128: | Line 138: | ||
===== Crop Block Finished! ===== | ===== Crop Block Finished! ===== | ||
- | If you completely | + | If you completed |
tutorial/crops.txt · Last modified: 2023/11/18 08:44 by solidblock