tutorial:blockentity
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:blockentity [2019/05/27 19:05] – modmuss50 | tutorial:blockentity [2019/06/29 23:49] – spelling fixes draylar | ||
---|---|---|---|
Line 19: | Line 19: | ||
Bellow will show you how to create the '' | Bellow will show you how to create the '' | ||
- | You can simply add variables to this barebone class or implement interfaces such as '' | + | You can simply add variables to this barebone class or implement interfaces such as '' |
===== Registring your BlockEntity ===== | ===== Registring your BlockEntity ===== | ||
Once you have created the '' | Once you have created the '' | ||
+ | |||
+ | The '' | ||
<code java> | <code java> | ||
- | public static BlockEntityType< | + | public static BlockEntityType< |
+ | |||
+ | @Override | ||
+ | public void onInitialize() { | ||
+ | DEMO_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY, | ||
+ | } | ||
</ | </ | ||
Line 42: | Line 49: | ||
If you want to store any data in your '' | If you want to store any data in your '' | ||
- | '' | + | '' |
<code java> | <code java> | ||
Line 66: | Line 73: | ||
</ | </ | ||
- | In order to retrieve the data later, you will also need to override '' | + | In order to retrieve the data later, you will also need to override '' |
<code java> | <code java> | ||
Line 82: | Line 89: | ||
===== Overview ===== | ===== Overview ===== | ||
- | You should now have your very own '' | + | You should now have your very own '' |
tutorial/blockentity.txt · Last modified: 2023/09/20 19:18 by haykam