Making a chest block with place functions

Started by XeanWolf20 on

Topic category: Help with modding (Java Edition)

Last seen on 18:25, 29. Jun 2023
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.

Last seen on 20:18, 12. Mar 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here you go!
Thu, 06/29/2023 - 16:35

There is a "Set item in slot of block at x: y: z: if it has inventory" block under Block management.

Here you go!