tutorial:blockstate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:blockstate [2024/08/24 14:13] – solidblock | tutorial:blockstate [2024/10/27 14:57] (current) – solidblock | ||
---|---|---|---|
Line 9: | Line 9: | ||
In fact, you can also use existing properties defined in vanilla, which can be found in '' | In fact, you can also use existing properties defined in vanilla, which can be found in '' | ||
+ | |||
+ | Create the class first: | ||
<code java> | <code java> | ||
public class ChargeableBlock extends Block { | public class ChargeableBlock extends Block { | ||
Line 16: | Line 18: | ||
super(settings); | super(settings); | ||
} | } | ||
- | | ||
- | // The block instance. You can place it anywhere. Make the class is initialized. | ||
- | public static final ChargeableBlock CHARGEABLE_BLOCK = new ChargeableBlock(FabricBlockSettings.copyOf(Blocks.STONE)); | ||
} | } | ||
</ | </ | ||
Line 25: | Line 24: | ||
<code java> | <code java> | ||
public final class TutorialBlocks { | public final class TutorialBlocks { | ||
- | public static final Chargeable CHARGEABLE_BLOCK = register(new ChargeableBlock(Block.Settings.copy(Blocks.STONE)), " | + | |
+ | | ||
+ | // For versions since 1.21.2: | ||
+ | public static final Chargeable CHARGEABLE_BLOCK = register(" | ||
| | ||
// [...] | // [...] |
tutorial/blockstate.1724508802.txt.gz · Last modified: 2024/08/24 14:13 by solidblock