Making a chest block with place functions

Started by XeanWolf20 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making a chest block with place functions

Hello, I'm trying to make a chest that when you place it, it take all the items in your inventory BUT armor, offhand and hotbar and places the rest in the chest so when you open it it has your items, it's an easy way to empty your inven if it's full and you have things to do. 

My thoughts are 

 

Get the players inventory and save it somehow, then on block placement, set the inventory of the chest to the players inventory.

I can't find code blocks to set the inventory of the block.