Jump to content

Sweetmimike

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Sweetmimike

  1. I have 2 classes : Miner (extends BaseEntityBlock) and MinerEntity (extends BlockEntity). Miner MinerEntity Everytime a user right click on Miner block, it calls MinerEntity#update. When debugging I noticed that when I call setChanged(), it takes many seconds to print "target not null" in the terminal.
  2. Thanks @diesieben07 for your answer. I noticed that when I apply a modification on the BlockEntity and immediately exit the game, the state of the blockEntity is not properly saved. It seems that it takes some seconds for the game to save it, but sometime it is immediately saved. Is there a way to avoid that ?
  3. Hello guys, I'm trying to make a mod that adds auto miner block. To do this I created a block and a block entity that save the itemStack when a user right click on the block (the auo miner will generate item depending on the itemStack set), and I need to save this itemstack in order to keep it even after a game restart. If I understood correctly, we need to use the "saveAdditional" function in order to save some tag on the entity. The thing is, how do you trigger this function everytime a user right click on the corresponding block entity ? In my case this function is sometimes called when we right click on the block entity and sometimes it takes many seconds before the function is called. Just below it's the saveAdditional fuction I'm using in a class that extends BlockEntity. @Override protected void saveAdditional(CompoundTag pTag) { if (target != null) { System.out.println("target not null"); pTag.put("target", target.serializeNBT()); } super.saveAdditional(pTag); } Thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.