User Tools

Site Tools


tutorial:blockentity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:blockentity [2020/05/07 19:15] – [Registring your BlockEntity] Fix typo in section header earthcomputertutorial:blockentity [2021/01/22 17:49] – Add BlockEntity#toTag BlockState parameter technici4n
Line 69: Line 69:
        
    // Serialize the BlockEntity    // Serialize the BlockEntity
 +   @Override
    public CompoundTag toTag(CompoundTag tag) {    public CompoundTag toTag(CompoundTag tag) {
       super.toTag(tag);       super.toTag(tag);
Line 84: Line 85:
 <code java> <code java>
 // Deserialize the BlockEntity // Deserialize the BlockEntity
-public void fromTag(CompoundTag tag) { +@Override 
-   super.fromTag(tag);+public void fromTag(BlockState state, CompoundTag tag) { 
 +   super.fromTag(state, tag);
    number = tag.getInt("number");    number = tag.getInt("number");
 } }
tutorial/blockentity.txt · Last modified: 2023/09/20 19:18 by haykam