Fabric API

Fabric API

106M Downloads

Inventory Deletes itself

DanielGolan-mc opened this issue ยท 6 comments

commented

Created a Custom Container (FuelChest) that when I'm exiting the world and coming back, cannot be opened, but if I brake the block, it's content dropped.

commented
  1. Not an api thing
  2. Make sure you save the contents to the tag in the read/write nbt methods to save the inventory
commented

I thought it's API because nobody could help me. See? I got the read / write! the problem is I can't open!

commented

Oh it can't be opened :concern: use break points to see it trying to open

commented

The onOpen() method not even being called

commented

You should register your screen handler in your mod main entrypoint. Call this to register your screen handler

public static <T extends ScreenHandler> ScreenHandlerType<T> registerSimple(Identifier id, SimpleClientHandlerFactory<T> factory) {

commented

Marking this as closed, please ask on the #mod-dev channels on our official Discord server if you have further questions.