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/06/29 23:49] – spelling fixes draylar | tutorial:blockentity [2020/05/07 19:15] – [Registring your BlockEntity] Fix typo in section header earthcomputer | ||
---|---|---|---|
Line 17: | Line 17: | ||
</ | </ | ||
- | Bellow | + | Below 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 | + | ===== Registering |
Once you have created the '' | Once you have created the '' | ||
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 | + | public class MyBlock extends Block implements BlockEntityProvider { |
- | public BlockEntity createBlockEntity(BlockView blockView) { | + | |
- | | + | |
+ | |||
+ | @Override | ||
+ | | ||
+ | return new DemoBlockEntity(); | ||
+ | } | ||
} | } | ||
</ | </ | ||
Line 85: | Line 92: | ||
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