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:09] – modmuss50 | tutorial:blockentity [2020/03/30 20:40] – 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 ===== | ||
Line 32: | Line 32: | ||
@Override | @Override | ||
public void onInitialize() { | public void onInitialize() { | ||
- | | + | |
} | } | ||
</ | </ | ||
- | Once your '' | + | ==== Connecting a Block Entity to a Block ==== |
+ | |||
+ | Once your '' | ||
<code java> | <code java> | ||
@Override | @Override | ||
public BlockEntity createBlockEntity(BlockView blockView) { | public BlockEntity createBlockEntity(BlockView blockView) { | ||
- | | + | |
} | } | ||
</ | </ | ||
Line 49: | Line 51: | ||
If you want to store any data in your '' | If you want to store any data in your '' | ||
- | '' | + | '' |
<code java> | <code java> | ||
Line 73: | Line 75: | ||
</ | </ | ||
- | 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 85: | Line 87: | ||
Once you have implemented the '' | Once you have implemented the '' | ||
- | If you need to sync some of your '' | + | If you need to sync some of your '' |
===== 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