The right way to get a chest (now 'Presents Plugin')

pwallis

New Member
Can someone point me at a design pattern that is the right way for a plugin to create a chest and putting something in it.

I can cast a block to a chest that I can use in game, but the server side inventory is of length 0 ?

---
Okay, I have found the 'Presents' plugin which is out of date, and I am trying to fix it. The challenge is the BlockEntityChest constructor which now takes a FullChunk and a CompoundTag as arguments. I think I see how to create the CompoundTag, but

Anyone know where I can find any documentation for the constructor
BlockEntity(FullChunk chunk, CompoundTag nbt) ?

---
looking at the source code, I now see how I would create the chunk and nbt args above, but it seems I should be using
level.setBlock(block, Block.get(BlockID.CHEST), true);
- which creates a chest in the right place in the game. I now need to find the related BlockEntity to get an inventory. If i use level.getBlockEntity(pos) where pos is the position of 'block' above, I get null... Back to converting the Presents Plugin...
 
Last edited:
Top