[Resolved] How to make a custom chest

Started by Mymann on

Topic category: Help with modding (Java Edition)

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Resolved] How to make a custom chest
Thu, 07/25/2024 - 16:47 (edited)

Need help with creating a block that function identical to a vanilla chest.

Requirements:

  • 27 slots for items
  • Can contain items
  • Break items when broken
  • Doesn't merge with other to create a double chest
  • Have animations for opening and closing, can utilize Geckolib if needed (I have already created the model that is just an edit of the single Chest).
  • Play vanilla chest sounds for when opening and closing.

Any help would be appreciated.

Edited by Mymann on Thu, 07/25/2024 - 16:47
Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make a GUI element with 27 …
Sat, 07/20/2024 - 03:34

make a GUI element with 27 "input" slots

go in the chest settings and activate "block entity" (the first checkbox) in the block entity tab, then select your gui in "bind this block to GUI" setting

select the "open bound GUI on right click" checkbox

set "size of inventory" to 27

deselect the "drop items from inventoy when block destroyed" checkbox

 

then for animations you need Geckolib but I already tried to do chest animations and I failed, so I hope someone else helps with that

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you your support, I…
Sat, 07/20/2024 - 07:58

Thank you your support, I was able to have everything else working only minus the animation part, I decided to just use the Geckolib plugin to have an animated block with set animations for it, that way I don't need to do any actual coding.

 

Now the only problem left is syncing up animation, idk why but the closing(3) animation is taking priority over the open(1) and using(2) animation, I need to name the animation as numbers because that is the only way to have it working, and despite that I set the the GUI procedures that play (1) when right-clicked and (2) while using and (3) when done using, the game plays (3) when open, then display no aniamtion and then play (3) again when finished.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think I had a similiar…
Sat, 07/20/2024 - 10:25

I think I had a similiar problem with block animations once and that I solved It, I'll see if I can find that workspace somewhere in my files and I'll check if I have some kind of solution for you

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why thank you, I will also…
Sat, 07/20/2024 - 11:48

Why thank you, I will also try to figure out a solution in the mean times, as a reference, here is my current method on how to get the animations played, the using and closing part are also formatted in a similar fashion, but only one animation is played.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So I checked that out, and I…
Sat, 07/20/2024 - 13:59

So I checked that out, and I didn't really fix it I just found an ugly come around, I did some tests and I figured out that the trigger "when this GUI is closed" in the GUI settings doesn't work at all, I tried assigning it to other procedures but it doesn't work, I think that it could be a MCreator bug

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What about the "GUI is being…
Sat, 07/20/2024 - 14:52

What about the "GUI is being used trigger"? If that false then perhaps I can just have only the "Chest lid stay open" trigger for during the actual usage of the chest, and the lid will move on its own to that position and back down when it is done using, assuming that it will actual move the parts to the position and not magically place it there that is.

Also, in my test the GUI closed DID worked, I tested to have it play the chest closing sound and it did play, only the actual animation is glitched.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think that your idea could…
Sat, 07/20/2024 - 14:57

I think that your idea could work, I tested the GUI closed trigger with execute command "give @p diamond" and it gave me the diamond only after I closed the GUI and then opened it again, so I don't know what to say, It's just that trigger that works weirdly maybe

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nah, it doesnt work, the…
Sat, 07/20/2024 - 16:47

Nah, it doesnt work, the animation system for these animated blocks is honestly so finicky and janky that made me wasted a good 4 hours on this chest animation thing with no avail, like in all animations, there can be only one animation that it can run at a time, and never in the order that I want it to. I don't even have ab ugly workaround for this as well, kindof make me wish to just copy some code for the animating part but idk where to.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah, I even tried something…
Sat, 07/20/2024 - 17:06

yeah, I even tried something with NBT and variables but it just doesn't work

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If anyone has or know some…
Sun, 07/21/2024 - 00:57

If anyone has or know some sort of code I can out in foe the animation, it would really be appreciated.

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay so I figured out how to…
Sun, 07/21/2024 - 07:42

Okay so I figured out how to get the animations working, basically there is an option in the "Visual" section to specify the number of animation procedures for the block, by default its 0 so you would need to increase it first. 

Now the problem is I need a way for the Closing animation to cancel out the Using animatuon when done with using the GUI.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There should be a block to…
Sun, 07/21/2024 - 10:58

There should be a block to stop animations for blocks in the GeckoLib tab

Last seen on 13:18, 7. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you mean the stop any…
Sun, 07/21/2024 - 13:24

you mean the stop any animation procedure block? I am figuring it out and it seems it doesn't really work for me. :(

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
At this point you should…
Sun, 07/21/2024 - 13:36

At this point you should just do something that only changes texture  when opened like barrels, chests seem impossible to make, I literally tried for one entire week in every possible way when I wanted one for my mod but nothing worked