Posted October 16, 20204 yr Hi, I working on making my Tile Entity store data, but when I tried to override the read function, there was no such thing. Here is my code: public class CopperCoreTileEntity extends TileEntity implements ITickableTileEntity { public int x, y, z; private int power = 0; private int tick; private boolean inited; public CopperCoreTileEntity(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); } public CopperCoreTileEntity() { this(ModTileEntityTypes.COPPER_CORE.get()); } public void tick() { if(!inited) init(); tick++; if(tick==6000 && power > 0) { power--; } } private void init() { inited = true; x = this.pos.getX() - 1; y = this.pos.getY() - 1; z = this.pos.getZ() - 1; tick = 0; } @Override public CompoundNBT write(CompoundNBT compound) { compound.put("initvalue", NBTHelper.toNBT(this)); return super.write(compound); } } How do I override the read function? Thanks in advance, Kid Koder Website: http://kidkoder.net GitHub: https://github.com/Uncodeable864
October 20, 20204 yr There is actually a read function it just isn't named. read(@Nonnull CompoundNBT nbt) → func_230337_a_(BlockState p_230337_1_, CompoundNBT nbt) When you override the function let your IDE complete it for you. It will define the BlockState is an input that you will have to use. I was able to find this list of functions through this website. You will need to know what they are named when you start creating your GUIs. [removed link to website with illegal forge rehosting - diesieben07] Edited October 20, 20204 yr by diesieben07
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.